在IE中的文本阴影的透明文本

ell*_*ale 5 internet-explorer transparent css3

当使用color: rgba(255,255,255,0.0);会同text-shadow: 0px 0px 2px rgba(255,255,255,1);时,Internet Explorer似乎继承了文字本身的文字阴影的透明度,导致阴影根本不出现.

JSFiddle示例(在IE中查看):http: //jsfiddle.net/495dZ/1/

是否有一种聪明的伪类技术可以解决这个问题?或者也许使用jQuery来实现类似的效果?

apa*_*aul 2

您可以将文本隐藏在窗口/屏幕边缘,也可以考虑为旧版本的 IE 添加后备。

工作示例

.black-box {
    background: url(http://i44.tinypic.com/2rzwis3.jpg) no-repeat;
    padding: 20px;
}
span.shadow {
    font: 20px Arial;
    position: absolute;
    left:-100px;
    top:-100px;
    color: rgba(0, 0, 0, 1);
    text-shadow: 120px 120px 2px rgba(255, 255, 255, 1);
}

<!--[if lte IE 9]>
    <style>
    span.shadow {
        position: static;
        display:inline-block;
        font: 20px Arial;
        color: rgba(255, 255, 255, 1);
        filter:progid:DXImageTransform.Microsoft.Blur(pixelradius=2.25);
        }
    </style>
<![endif]-->

<div class="black-box"> 
    <span class="shadow">This is some text.</span>
</div>
Run Code Online (Sandbox Code Playgroud)