0

我正在尝试在按钮上添加渐变效果。我正在使用 Less 语法。

我目前将此应用于我的元素:

过滤器:~"progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffeaa5', endColorstr='#f8b000',GradientType=0)";

但是我的按钮上没有显示渐变。任何想法?

谢谢你。

编辑:它适用于这个 jsfiddle: http: //jsfiddle.net/FBfSZ/ 但不在此页面上:http ://canapin.com/web/ (查看源代码)

我不明白。

4

3 回答 3

1

试试这个我在 IE 8 上测试它

filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffeaa5', endColorstr='#f8b000',GradientType=0 );
于 2012-10-04T17:48:42.180 回答
0

Maybe it's because your page is not a valid HTML page, so the IE switches to the quirks mode. You can easily see it yourself, when you press F12, to get the developer mode.

Create a valid HTML page, with doctype, header element and all the like, i think it should work then.

于 2012-10-10T20:53:08.267 回答
0

这适用于 IE8,它来自 twitter bootstrap

filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d',
 endColorstr='%d', GradientType=0)",#ffeaa5,#f8b000)); // IE9 and down
于 2012-10-10T17:46:39.940 回答