Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

You have no background-color set (or background-color is set to transparent) but you have set a color

I'm getting this Warning (it's not a error, my CSS is valid).

I choosed full report just to check to validate

You have no background-color set (or background-color is set to transparent) but you have set a color. Make sure that cascading of colors keeps the text reasonably legible.

What is this and how to solve. I'm getting this on total 57 selectors.

like image 622
Jitendra Vyas Avatar asked Apr 23 '10 11:04

Jitendra Vyas


3 Answers

Good explanation @graphicdevine on why the warnings are there.

Instead of hard-coding

background-color: #xxx;

for each tag, I read on a forum that suggested putting this in:

background-color: inherit;

Also, anywhere you set a background color but not a text color, put in:

color: inherit;

It resolved all of those type of warnings for me.

like image 169
Curtis Avatar answered Oct 11 '22 05:10

Curtis


It covers theoretical problem when font colour is same as the backgound, i.e:

background-color: #fff;
color: #fff;

You don't need to worry about it, but if you want to get rid of the warrning I'm guessing just set the background colour as per the message.

like image 27
rochal Avatar answered Oct 11 '22 04:10

rochal


Add background-color:#/*whatever you want*/; to all 57 selectors and you should be fine.

like image 40
Kyle Avatar answered Oct 11 '22 04:10

Kyle