Sunney 0 Posted November 4, 2005 Report Share Posted November 4, 2005 Hi there,Does anyone know why the CSS validator gives an error when I use:background-color: transparent;It gives the following warning when I use that.# Line : 131 (Level : 1) You have no background-color with your color : td# Line : 139 (Level : 1) You have no background-color with your color : .pricelisttext# Line : 148 (Level : 1) You have no background-color with your color : .linkpointer# Line : 157 (Level : 1) You have no background-color with your color : .linktekst# Line : 163 (Level : 1) You have no background-color with your color : a:linkAnd the list goes on,...All are specifications with "background-color: transparent;" in them.Anyone know what's up with this??Thanks! Quote Link to post Share on other sites
actionsketch 0 Posted November 6, 2005 Report Share Posted November 6, 2005 I'm not sure background-color: transparent; is legal... try background-color: none;But if I'm wrong, then it's most likely because the validator warning you that the text might be hard to read if it isnt on a solid background color. Quote Link to post Share on other sites
F-Man 0 Posted November 6, 2005 Report Share Posted November 6, 2005 I'm wondering the same thing. Maybe it's a bug with the validator, though if you really want it to stop complaining, you can use background-color: inherit. Personnaly, I really can't think of a reason you should define a background-color to every selectors with color. Quote Link to post Share on other sites
Sunney 0 Posted November 6, 2005 Author Report Share Posted November 6, 2005 Actually I didn't use to have any background-color declaration in those elements. But the Validator told me (a year ago) that a background-color must be defined. So I made them al transparent and that was ok. It's just recent (couple of weeks?) that the validator now gives a warning on those element for the transparent statement. The validator did not use to do that.Anyway,.. I tried the value "none". But that is not a valid value.Also I tried the value "inherit". In that case the validator indeed does not give a color warning anymore. I'll have to check my pages to see if it works out ok.[edit]It seems "inherit" is semi-valid?When I use "inherit" in the background-color statement than it's ok.But if i use the shorthand property background (instead of background-color) togeher with more values than the validator tells me "inherit" an invalid value.So:This is ok:background-color: inherit;background: inherit;This is not ok:background: inherit url(../pics_fun/g4.gif) no-repeat;[/edit]Thanks for your help![edit2]PS: did you ever try this CSS check?hxxp://www.htmlhelp.com/tools/csscheck/It gives a whole new list of warnings [/edit2] Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.