Ron Koster wrote:
> "You have no background-color set (or background-color is set to 
> transparent) but you have set a color. Make sure that cascading of 
> colors keeps the text reasonably legible."
> 
> How on earth is that a "warning"? If I set a background color for my 
> links or whatever else, well, then there goes my background graphic 
> out the window.

The validator does not know where things are.

This is a message to warn you to pay attention yourself to the coloring of
your page. Let's say you have a DIV with a yellow background, and inside
that you have another div with a transparent background and yellow text.
That text will then be invisible (or illegible, if it's a slightly different
yellow). If, however, that outer div has a dark blue background, it might be
perfectly valid to have yellow text on a transparent background.

If it's a simple matter of <div id="blue"><div id="yellow">text</div></div>,
with no other rules like negative margins or absolute positioning, then in a
perfect world the validator should know that the yellow text will be on a
blue background, and not warn you. However, once you start moving things
around or using background images, the validator would have to include a
rendering engine to determine whether your yellow text might shift
(partially) out of that blue box and onto something else's background, which
might also be yellow, or whether that particular part of the background
image underneath your yellow text happens to be yellow as well.

Obviously, that's not what a CSS validator is for. It's there to allow you
to check whether you have written valid CSS. Hence the warning (and not an
error) to notify you that you need to check for yourself whether the given
text color is visible on the background it has.

If you *do* set a background and foreground color in the same style
definition block, the validator can warn you if the colors are too close for
comfort, but I consider this to fall under accessibility validation, and not
CSS validation.

Hope that explanation made sense :)

Regards,
Rick.

______________________________________________________________________
css-discuss [cs...@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to