Forum Moderators: not2easy
My first instinct was to make whatever fixes are necessary, but as other people have pointed out, for a large site, the code bloat in the stylesheet would be a nightmare - we've spent a long time trying to cut down the size of the stylesheet, not increase it!
On more specific points such as the need to specify a background color if you've specified a foreground color - why doesn't everything just inherit the background color of the body if you've specified one?
Other warnings I've noticed are things like 'Same colors for background-color and border-left-color' - why would this even matter?
Other warnings also include stuff I don't understand, such as:
Redefinition of border-top-style
This property applies to block-level elements.
Can anyone shed any light on these or offer general thoughts or advice? What would be the 'best practice' advice for this?
why doesn't everything just inherit the background color of the body if you've specified one?
Background colours don't inherit; they default to transparent. Now say someone prefers to read white text on a black background and sets up a user stylesheet to apply those rules to <body>. If you've defined your <p>s to have black text, but forgotten to define a background colour of white, then they'll see the black text you've defined ontop of the black background they've defined, and won't be able to read anything.
At the end of the day they're warnings, not errors. It's up to you to evaluate them and decide whether they're worth fixing.
It's up to you to evaluate them and decide whether they're worth fixing
This is what I have a problem with. If what you say about colors/background colors is true (and I'm sure it is ;)) then they are all worth fixing. However, increasing our stylesheet to an unwieldy size would adversly affect usability for everyone wouldn't it?
What if background colors did inherit, rather than default to transparent? Would this cause any problems with stylesheets? Or would it save lots of problems (warnings) and code bloat? Just a theoretical question mind ;)
[w3.org...]
You have no background-color with your color
This simply is invalid as "transparent" is a valid W3C value. It it's specified then the webmaster has consciously decided that value thus negating the need for a color. Not sure who these people are who are arguing against transparent but it's a valid W3C spec and the validator is either right or wrong and in this case it's wrong.
Just like on Mozilla's Bugzilla you're going to find people who don't know what they are talking about who don't want to fix things.
John
[webmasterworld.com...]
All new style sheets that I create now have color and background colors assigned where applicable so that I can validate without any warnings. It's a tedious process and requires some different methods of thinking and design but, I just don't like seeing those warnings. ;)