这个警告应该是直截了当的,但我无法弄清楚发生了什么问题。CSS'你没有颜色设置[...]'警告
来自W3C验证确切的警告消息:You have no color set (or color is set to transparent) but you have set a background-color. Make sure that cascading of colors keeps the text reasonably legible.
这就是发生报警的CSS:
body {
background-image: url('./img/bg1.jpg');
background-position: center top;
background-repeat: no-repeat;
color: #ffffff;
background-color: #007e29; /* <-- This is the line where the warning occurs */
}
根据W3C的Docu和一些谷歌搜索,很显然,对于每个background-color
此元素必须有color
属性。但这是我在做什么? color
属性设置为白色,background-color
设置为深绿色。
那么上面的CSS有什么问题? 我相信我在这里失去了一些东西......在此先感谢!
在CSS验证器(和HTML验证器)中的警告没有什么意义。我通常完全忽略它们。 – 2012-08-17 09:24:54
您是否尝试过在'color:#fff;'行之前移动您的'background-color:#007e29;'行? – techfoobar 2012-08-17 09:25:07
我刚刚在W3 CSS验证器中验证了它。 – Kyle 2012-08-17 09:25:19