Welcome to WebmasterWorld Guest from 23.22.182.29

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)

Junior Member

10+ Year Member

joined:Oct 17, 2002
posts:99
votes: 0


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)

Senior Member

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

joined:Mar 15, 2002
posts:6807
votes: 0


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)

Full Member

10+ Year Member

joined:Dec 13, 2002
posts:307
votes: 0


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)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Mar 8, 2003
posts:1429
votes: 0


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;