Jump to content
Sunney

Error with transparent background color

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!

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
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]

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...