Re: Rationale for the warning "Same colors for color and background-color in two contexts"?

4.10.2011 23:01, Philip TAYLOR (Webmaster, Ret'd) wrote:

>> a { color: black; }
>> b { background: black; }
> Well. Isn't it simply the case that we are discussing
> CSS, rather than CSS embedded in HTML, and therefore
> the CSS validator can have no knowledge as to whether
> an <a> element will be embedded in a <b> element, and
> therefore seeks to warn the user that such a usage
> would be ill-advised ?

The CSS validator surely needs to deal with CSS in general, without 
information about the meanings of elements or their allowed or actual 
nesting. But if the warning is based on speculation on possible nesting 
and the possible effects of background transparency, I'm afraid it goes 
far too far. Are there any real problems that have been detected thanks 
to these warnings? I'm pretty sure there are many more problems 
(confusion among authors) _caused_ by the warnings.

In any case, if these warnings are issued, they should be explained in 
the CSS Validator FAQ or in other documentation.

> However, I should report that that page, when validated,
> does /not/ throw up the warning that you report, at least
> by default :

Oddly enough, if I go to and either 
enter your URL in the "By URI" dialog or copypaste its content into the 
"By direct input" dialog, without changing the defaults, I do get the 
warning. And I checked that in "More Options", Warnings are set to 
"Normal report".


Received on Tuesday, 4 October 2011 20:29:42 UTC