<bi******@yahoo.co.uk> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
Hi,
I am running a w3c CSS validation check on a site in development. I
have many errors saying that my CSS is not valid because I have not
defined the background-color but instead left it default transparent.
Why does it require that every CSS defined element have their
background-color defined?
If you set one colour then set them all. If you don't then it isn't a
validation error, just bad practice.
If my browser was set to display white text on a black background and I
visited a site where the text was set to black and the background colour
hadn't been set then the page would be black text on a black background.
Also, when I set styles in the following way:
#div {
background: #FFF url('images/bg.gif');
}
...it still gives me an error saying that I havent defined
background-color. Is the above an invalid way of writting it?
If I feed your CSS snippet through the W3C CSS validator then it comes up
with this message: "Line : 1 (Level : 1) You have no color with your
background-color : #div"
The background colour *has* been set but you haven't set any foreground
colour.
eg: #div {background: #FFF url('images/bg.gif'); color:#000000}