Re: CSS validator report has changed

Hello,

Your stylesheet probably looks like:
.foo {
  background-color: #fff;
  color: #000;
}
.bar {
  color: #fff;
}
There is nothing that prevents an element with the class bar from being
used inside an element with the class foo.
For example, you could have an HTML containing this piece of code:
<p class="foo">
  <a class="bar">...</a>
</p>
In this case, the style "background-color: #fff; color: #fff" would apply
to the a.bar element.
The message you talk about warns you about this possible kind of problems,
even if your html document does not have this structure. This is a "be
careful" warning.

Jean-Guilhem Rouel

> Two days ago I tested a HTML page with the CSS validator and it passed
> with
> no errors. Today after making some slight amendments tested the same page
> and received 300 warnings regarding, mainly, colours. Many of the warnings
> were similar to -
>
> Line : 39 (Level : 1) Same colors for color and background-color in two
> contexts .legalbar and .faqsubheader
>
> as the two classes have no relation to each other and can't be used on the
> same item what is the point of the warning. Surely it is allowable to have
> the same foreground colour in one circumstance as a background colour in
> another circumstance.
>
> Has your validator analysed this correctly, if so, what is the purpose of
> pointing this out, especially as 2 days ago it did not.
>
> Graham Williams
>

Received on Friday, 16 September 2005 09:14:36 UTC