Is the filter: progid:DXImageTransform.Microsoft.DropShadow(OffX="x", OffY="y", Color="color")
method a viable replacement for the text-shadow:
attribute in non-IE browsers?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Yes, but they are not exactly the same.
I don't believe you can do multiple text shadows with the proprietary IE method.
回答2:
Yes, they are roughly equivalent, per what Alex said. BUT - the IE filter renders in a hideously ugly way.
If text shadow is necessary (I just let IE go without for the most part, but sometimes it's needed), one method I found was to literally duplicate the desired element, position it under the target element, then apply the blur filter to the duplicate, as it renders much nicer.
For example, if you have jquery, and want to target H2's:
$("h2").each(function(){
var h2_tx_Shadow = $(this).html();
$(this).append("<span class='shadow_h2'>"+h2_tx_Shadow+"</span>");
});
Then in CSS:
span.shadow_h2 {
position:absolute; top:0px; left:0px; z-index:-1;
filter:progid:DXImageTransform.Microsoft.Blur(PixelRadius='2',MakeShadow='true',ShadowOpacity='0.40');
}
I wish I could find the thread where I found this idea - it may have even been on SO - so, apologies to the original person who came up with this!