这是关于 http://jsfiddle.net/Eu5by/11/ 的一个例子和 http://jsfiddle.net/Eu5by/12/
(更新:实际上,它不需要是链接:请参阅 http://jsfiddle.net/Eu5by/14/,它只是文本)
代码基本上是:
<div id="main-box">
<a id="box" href="http://www.google.com">
hello world
</a>
</div>
使用 CSS
#main-box {
filter: progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#dddddd')
}
#box {
display: block; width: 300px; height: 60px; line-height: 60px; text-align: center; background: #ffc; color: #ff7000;
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f3f9ff', endColorstr='#e8f3ff',GradientType=0 )
}
文本在 IE 8 上会显示为灰色。第一个 jsfiddle 链接使用 filter
而第二个使用 -ms-filter
有没有办法解决这个问题?
(我正在虚拟机上尝试 IE 8。如果它在我的 IE 9 上,那么它工作正常。)
在 IE 8 上,如果删除阴影或渐变,则链接将再次具有正确的颜色。
最佳答案
有一个 bug documented on QuirksMode .
尝试将缩放系数设置为 100% 以外的任何值;)
关于css - IE 8 错误?带有渐变背景的阴影,文本变成灰色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5706403/