...

View Full Version : CSS Validation Warnings



greasonwolfe
03-11-2006, 08:34 AM
I've been working to validate my CSS through W3C and though it validates as good, it does give me some warnings and I am a bit confused as to how to interpret these warnings. For example, if I have the following code in the style portion of my page;



body {
background-image: none;
background-color: #ffffff;
margin: 5px;
}

td.something {
background-image: none;
background-color: #ffffff;
border-color: #000000;
border-width: 1px;
border-style: solid;
vertical-align: middle;
text-align: center;
font-style: normal;
font-size: medium;
font-weight: bold;
color: #000000;
font-family: "Tahoma";
}

p {
background-color: transparent;
margin: 1%;
font-style: normal;
font-size: small;
font-weight: normal;
color: #000000;
font-family: "Tahoma";
}


I get the following warnings;



Line : 18 (Level : 1) You have no color with your background-color : body
Line : 51 (Level : 2) font-family: You are encouraged to offer a generic family as a last alternative : td.something
Line : 60 (Level : 1) You have no background-color with your color : p


Some of these warnings (like the one for generic font family) I understand. However, the warnings about no background-color are leaving me a bit confused. I've tried using all UpperCase letters as well as all LowerCase letters and I still get the same warnings. Can someone explain this to me please.

GW

_Aerospace_Eng_
03-11-2006, 08:48 AM
Use background:none; instead

greasonwolfe
03-11-2006, 08:53 AM
I am assuming you mean that it should look like this instead?



body {
background: none;
margin: 5px;
}


And so on?

_Aerospace_Eng_
03-11-2006, 09:07 AM
body {
background-color: #ffffff;
color: #000000; /*The validator is giving you a warning about not having a color in your body so put one*/
margin: 5px;
}

td.something {
background-color: #ffffff;
border-color: #000000;
border-width: 1px;
border-style: solid;
vertical-align: middle;
text-align: center;
font-style: normal;
font-size: medium;
font-weight: bold;
color: #000000;
font-family: "Tahoma";
}

p {
background:none;
margin: 1%;
font-style: normal;
font-size: small;
font-weight: normal;
color: #000000;
font-family: "Tahoma";
}

greasonwolfe
03-11-2006, 04:42 PM
Gotcha!

Thanks

GW



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum