1

我读到语法已更新以删除前缀,但我尝试了以下所有方法,但它们都不起作用:

  background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#82dc7b), to(#61a45c));
        -webkit-linear-gradient(top, #82dc7b, #61a45c);
        -moz-linear-gradient(top, #82dc7b, #61a45c);
        -ms-linear-gradient(top, #82dc7b, #61a45c);
        -o-linear-gradient(top, #82dc7b, #61a45c);
        linear-gradient(to bottom, #82dc7b, #61a45c);
4

2 回答 2

2

这样的事情怎么样?

background: #82dc7b; /* Old browsers */
background: -moz-linear-gradient(top,  #82dc7b 0%, #61a45c 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#82dc7b), color-stop(100%,#61a45c)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top,  #82dc7b 0%,#61a45c 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top,  #82dc7b 0%,#61a45c 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top,  #82dc7b 0%,#61a45c 100%); /* IE10+ */
background: linear-gradient(to bottom,  #82dc7b 0%,#61a45c 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#82dc7b', endColorstr='#61a45c',GradientType=0 ); /* IE6-9 */

查看以下资源以获取帮助: http: //www.colorzilla.com/gradient-editor/

于 2013-09-27T15:26:38.017 回答
1

尝试这个:

background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#82dc7b), to(#61a45c));
background: -webkit-linear-gradient(top, #82dc7b, #61a45c);
background: -moz-linear-gradient(top, #82dc7b, #61a45c);
background: -ms-linear-gradient(top, #82dc7b, #61a45c);
background: -o-linear-gradient(top, #82dc7b, #61a45c);
background: linear-gradient(to bottom, #82dc7b, #61a45c);

另外,请查看http://colorzilla.com/gradient-editor/

于 2013-09-27T15:24:19.017 回答