有人能告诉我为什么以下的CSS没有验证?我一直在努力研究这个,没有运气 . 我读过的所有文档都说这是为什么在css3中做渐变的正确方法 .
#header {
color: white;
font-size: 12px;
font-family: Helvetica, Verdana, Arial, sans-serif;
background: black;
background: -moz-linear-gradient(top, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0) 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(0,0,0,0.65)), color-stop(100%,rgba(0,0,0,0)));
background: -webkit-linear-gradient(top, rgba(0,0,0,0.65) 0%,rgba(0,0,0,0) 100%);
background: -o-linear-gradient(top, rgba(0,0,0,0.65) 0%,rgba(0,0,0,0) 100%);
background: -ms-linear-gradient(top, rgba(0,0,0,0.65) 0%,rgba(0,0,0,0) 100%);
background: linear-gradient(top, rgba(0,0,0,0.65) 0%,rgba(0,0,0,0) 100%);
width: 100%;
height: 35px;
margin-top: 0px;
margin-left: auto;
margin-right: auto;
padding: 10px;
position: fixed;
top: 0px;
z-index: 1000;
}
这些是我得到的验证错误:
TextArea的W3C CSS Validator结果(CSS级别3)抱歉!我们发现了以下错误(6)URI:TextArea 6 #header Value Error:background-color -moz-linear-gradient(top,rgba(0,0,0,0.65)0%,rgba(0,0,0, 0)100%)不是背景颜色值:-moz-linear-gradient(top,rgba(0,0,0,0.65)0%,rgba(0,0,0,0)100%)7# Headers 值错误:background-color -webkit-gradient(线性,左上,左下,颜色停止(0%,rgba(0,0,0,0.65)),颜色停止(100%,rgba(0, 0,0,0)))不是背景颜色值:-webkit-gradient(线性,左上,左下,颜色停止(0%,rgba(0,0,0,0.65)),颜色 - 停止(100%,rgba(0,0,0,0)))8 #header值错误:background-color -webkit-linear-gradient(top,rgba(0,0,0,0.65)0%,rgba( 0,0,0,0)100%)不是背景颜色值:-webkit-linear-gradient(top,rgba(0,0,0,0.65)0%,rgba(0,0,0,0) )100%)9 #header Value Error:background-color -o-linear-gradient(top,rgba(0,0,0,0.65)0%,rgba(0,0,0,0)100%)不是背景颜色值:-o-linear-gradient(top,rgba(0,0,0,0.65)0%,rgba(0,0,0,0)100%)10 #header Va lue错误:background-color -ms-linear-gradient(top,rgba(0,0,0,0.65)0%,rgba(0,0,0,0)100%)不是背景颜色值: - ms-linear-gradient(top,rgba(0,0,0,0.65)0%,rgba(0,0,0,0)100%)11 #header Value Error:background-color linear-gradient(top,rgba (0,0,0,0.65)0%,rgba(0,0,0,0)100%)不是背景颜色值:线性渐变(顶部,rgba(0,0,0,0.65)0 %,rgba(0,0,0,0)100%)
3 回答
这是一个副本:CSS background gradient validation
一个很好的解释是:
http://net.tutsplus.com/tutorials/html-css-techniques/quick-tip-understanding-css3-gradients/comment-page-1/#comment-243334
供应商特定扩展do not validate . 此外,您可能需要更改W3C验证服务选项以更改CSS配置文件级别,如this link所示 .
无论如何,我不担心我的CSS3声明没有验证,因为验证只是一个指导你纠正可能的代码错误 .
确保为“配置文件”设置了正确的选项 . 它应该是css级别3.而验证器并不真正支持供应商特定的css .