【发布时间】:2014-03-24 09:17:45
【问题描述】:
我对 ie8 和 9 浏览器的渐变混合有问题,因为渐变混合似乎有一个小错误,因为来自 gradien 的六进制代码有很多字符是由引导混合产生的。如果有人遇到这个问题并解决了,请分享。 这是来自引导程序的较少混合:
.vertical(@start-color: #555; @end-color: #333; @start-percent: 0%; @end-percent: 100%) {
background-image: -webkit-linear-gradient(top, @start-color @start-percent, @end-color @end-percent); // Safari 5.1-6, Chrome 10+
background-image: linear-gradient(to bottom, @start-color @start-percent, @end-color @end-percent); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+
background-repeat: repeat-x;
filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",argb(@start-color),argb(@end-color))); // IE9 and down
}
变量:
@table-header1: rgba(155,214,45,0.65);
@table-header2: rgba(123,192,67,0.99);
少:
.table {
thead tr {
font-weight:normal;
#gradient > .vertical(@table-header1 , @table-header2);
th {
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
color: @asf-table-th-color;
border-color:#428BCA;
border-width: 1px;
font-weight:bold;
}
}
}
这是这个 mixin 的结果:
.table thead tr {
font-weight: normal;
background-image: -webkit-linear-gradient(top, rgba(155, 214, 45, 0.65) 0%, rgba(123, 192, 67, 0.99) 100%);
background-image: linear-gradient(to bottom, rgba(155, 214, 45, 0.65) 0%, rgba(123, 192, 67, 0.99) 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#a69bd62d', endColorstr='#fc7bc043', GradientType=0);
}
现在如果你仔细看一下,即过滤梯度的十六进制代码有很多字符。
这是一个带有正确十六进制代码的 ie8 渐变示例:
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#1e5799', endColorstr='#7db9e8',GradientType=0 );
【问题讨论】:
标签: twitter-bootstrap less mixins