CSS background gradient validation

早过忘川 提交于 2019-12-01 15:27:55

问题


I've got a number of CSS styles in my site's stylesheet that use the following, or variations of:

background: -webkit-gradient(
    linear,
    left bottom,
    left top,
    color-stop(0.0, #585858),
    color-stop(1.0, #ACACAC)
);
background: -moz-linear-gradient(
    center bottom,
    #585858 0%,
    #ACACAC 100%
);

My problem is that when it comes to validating the CSS using the W3C Validator, I get the following error:

Value Error : background -webkit-gradient(linear,left bottom,left top,color-stop(0.0,#585858),color-stop(1.0,#acacac)) is not a background value : -webkit-gradient(linear,left bottom,left top,color-stop(0.0,#585858),color-stop(1.0,#acacac)) -webkit-gradient(linear,left bottom,left top,color-stop(0.0,#585858),color-stop(1.0,#acacac))

As far as I'm aware, the CSS is fine...is this a problem with the validator I should make the testing team I work with aware of?


回答1:


You are using vendor specific experimental implementations of CSS properties. They aren't valid CSS.

One of the options for the validator will allow you to downgrade vendor extensions from errors to warnings in the reports (so if you are choosing to use them on a production site you can find any errors that aren't related to using non-standard extensions).



来源:https://stackoverflow.com/questions/5715281/css-background-gradient-validation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!