开发者

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 t开发者_开发问答ext reasonably legible.

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


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.


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.


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


You solve it by:

Make[ing] sure that cascading of colors keeps the text reasonably legible.

It's a warning that there might be something wrong, but that no tool is capable of discerning whether or not there actually is anything wrong.

(And of course, 'reasonably legible' is pretty open to interpretation. I use colour contrast analyser, many other, similar tools exist.)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜