Jump to content

Error with transparent background color


Sunney

Recommended Posts

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!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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]

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...