Welcome to WebmasterWorld Guest from 54.145.208.64

Forum Moderators: not2easy

Message Too Old, No Replies

Is complete W3C CSS validation important?

or can the "no background colour specified" errors be ignored ...

   
4:56 pm on Mar 12, 2003 (gmt 0)

10+ Year Member



When I use W3C's css validator, the only errors, or rather warnings, I receive are those relating to "no background colour specified" etc. Is it really important to specify transparent background colour for each element - I've been avoiding it to keep the css file size at a minimum.
5:01 pm on Mar 12, 2003 (gmt 0)

WebmasterWorld Senior Member drdoc is a WebmasterWorld Top Contributor of All Time 10+ Year Member



The reason why you're "supposed to" always specify both, even if it is redundant, is in case someone set their own local CSS file.

For example, say that some "blockheaded Bracegirdle from Hardbottle" specified black as their background color, and as the only CSS rule on their local machine. Well, you can guess what most Web sites would look like. ;)

5:02 pm on Mar 12, 2003 (gmt 0)

10+ Year Member



Most browsers can render background inheritance correctly, I can't think of one that does.

Its good practice, if you're someone concerned about accessibility and validation; otherwise its often quite omittable, IMO. There's no strict line on it really, after all, its only a warning, not an error.

FYI, if I'm building a site from the ground up, I do try to have colour and background color styles for relevant elements, but for existing sites its often too big a chore.

10:48 am on Mar 15, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Most browsers can render background inheritance correctly, I can't think of one that does.

Or rather they render incorrect background inheritance correctly ;)

If you just want the background colour to be the same as its parent then you can use

background-color: transparent;

alternatively I think you can also use
background-color: inherit;