Re: Please let me know about these warnings

On 2010-02-08 3:34 AM, priya wrote:
> I have validated css for the following url with css level 3 but still
> showin 5 warning while no error in my code.

I think that those warnings are to guard against custom user style
sheets and missing background images.

Insofar as I'm aware, every browser allows you to change your default
background and text colors (which are white and black). Unfortunately, a
lot of CSS authors set only the text color or the background color while
leaving the other undefined which can create very unreadable Web sites
when users define their own preferred colors.

Example 1:
A. Author defines the text color as black and leaves the background
color undefined.
B. User defines the default text color as white and default background
color as dark gray, but defers to the author's colors if specified.
Result of A + B: User sees black text on a dark gray background making
the Web site unreadable.

Example 2:
A. Author defines the background color as white and leaves the text
color undefined.
B. User defines the default text color as lavender (light purple/blue)
and default background color as dark gray, but defers to the author's
colors if specified.
Result of A + B: User sees lavender text on a white background making
text invisible and the Web site unreadable.

Example 3:
A. Author defines the link text color as blue leaving the background and
(non-link) text colors undefined.
B. User defines the default text color as white and background color as
blue, but defers to the author's colors if specified.
Result of A + B: User sees white (non-link) text on a blue background
(which is fine), but all link text is blue on a blue background and
invisible.

Example 4:
A. Author adds a dark-colored background image to an element and defines
a light-colored (contrasting) text color for that element. The default
background and text colors are not specified.
B. The dark-colored background image takes awhile to load on the user's
machine or doesn't display at all. Their default colors are the browser
defaults of white (background) and black (text).
Result of A + B: User temporarily or permanently can't read the text
because light-colored text appears over a white (light-colored)
background until the dark-colored background image loads.

Summary: If you define (non-link) text colors, link text colors, or
background colors or use a background image whose color doesn't match
the background behind it, then you need to specify *all* of the colors 
to guard against custom style sheets or image loading issues.

Unfortunately, this warning is not explained by the CSS validator and
lots of people are confused by it.

Received on Thursday, 11 February 2010 06:02:47 UTC