CSS Validation Problem

Soldato
Joined
18 Oct 2002
Posts
4,410
I'm getting the following W3C CSS validation warning:

"You have no background-color with your color"

The problem is that it's for link text which may be on different backgrounds, one of which is a graduated image. I'd like the background of the text to be transparent so I don't really want to specify a background colour for it at all but I do want to specify the colour of the text so I do need to specify the color attribute. Unfortunately, that doesn't seem possible. Am I asking too much? Is this not an issue with W3C's CSS validation that it can't accept that link text may need to be placed over different backgrounds?

I can't even set the following:

background-color: transparent;

While this is valid CSS (the default bg colour for an element is "transparent"), the validator still seems to demand a solid colour :confused:
 
Last edited:
Soldato
OP
Joined
18 Oct 2002
Posts
4,410
Beansprout said:
There's basically not much you can do, although there's a couple of sometimes-useful tips here :)
Thanks for that, from the tips on there I used this:

background: inherit;

And why didn't I think of that myself? :o
 
Soldato
Joined
18 Oct 2002
Posts
5,464
Location
London Town
Bear in mind that this is only a warning. The validator is just a script; it has no sense of context and does not analyse colour contrast, legibility and so on. Hence why it warns about the possibility of an issue being present in your CSS. You can ignore warnings for the most part.

The extra bandwidth requirements for a completely clean mark-sheet are not worth the bother when the additional rules aren't actually providing any real-world benefit :).
 
Back
Top Bottom