Matthias Gutfeldt <say-no-to-> wrote:
> Someone in alt.php claimed it's not
> valid. The guy obviously didn't understand CSS.
Well, who _does_ understand CSS? We just have different holes in our
understanding. And this includes people who sort-of have defined and are
redefining CSS.
Anyway, the CSS rule
.dog td.toprow {color:red;background-color:blue;}
complies with CSS specifications (both CSS 1 and CSS 2) under any
interpretation. Some people say that this means it's "valid". Well, that's a
bit confusing, but not that it would remain exactly as "valid" if you
replaced the color name blue by the color name red (making text color and
background color the same).
It's not god CSS practice, though. The colors used (the "pure" colors) are
usually unsuitable for use on the Web, and that particular color combination
is not very good. Moreover, it would be better to set background, not just
background-color, since now any other style sheet that participates in the
cascade may freely set a background image, e.g. a nice Christmas-style
background which has strong red colors and little else.
As a practical consideration, it would be more natural to assign a class to
a <tr> element than to each <td> inside it separately. The latter approach
might escape some browser bugs, though.
--
Yucca,
http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring:
http://www.cs.tut.fi/~jkorpela/www.html