CSS IE7 和 IE8 中的框阴影
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8181699/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Box shadow in IE7 and IE8
提问by Shades88
I want to implement box shadows in IE7 and IE8. I have tried everything without succeeding. Here is the css that I am using to apply colored shadow to a div:
我想在 IE7 和 IE8 中实现框阴影。我已经尝试了一切但没有成功。这是我用来将彩色阴影应用于 div 的 css:
.bright{
position: absolute;
z-index: 1;
-moz-box-shadow: 0px -3px 55px 20px #147197;
box-shadow: 0px -3px 55px 20px #147197;
-webkit-box-shadow: 0px -3px 55px 20px #147197;
behavior: url(ie-css3.htc);
}
This ie-css3.htc file is a solution to IE shadow problems. But it only gives black shadows, not colour shadows. I tried:
这个 ie-css3.htc 文件是解决 IE 阴影问题的方法。但它只给出黑色阴影,而不是彩色阴影。我试过:
filter: progid:DXImageTransform.Microsoft.Shadow(color='#969696', Direction=100, Strength=13);
But it creates a directional shadow, and I want an omni-directional shadow. Also tried blur filter but it needs to have additional divs which is unadvisable in my current case. Any expert opinion on this problem ?
但它创建了一个定向阴影,我想要一个全方位的阴影。还尝试了模糊过滤器,但它需要有额外的 div,这在我目前的情况下是不可取的。关于这个问题的任何专家意见?
回答by thirtydot
Use CSS3 PIE, which emulates some CSS3 propertiesin older versions of IE.
使用CSS3 PIE,它在旧版本的 IE 中模拟一些 CSS3 属性。
It supports box-shadow
(except forthe inset
keyword).
它支持box-shadow
(除了所述inset
关键字)。
回答by iamari
in ie8 you can try
在ie8你可以试试
-ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=5, Direction=135, Color='#c0c0c0')";
filter: progid:DXImageTransform.Microsoft.Shadow(Strength=5, Direction=135, Color='#c0c0c0');
caveat: in ie8 you loose smooth fonts for some reason, they will look ragged
警告:在 ie8 中,由于某种原因,您会丢失平滑的字体,它们看起来会很粗糙
回答by user2795385
You could try this
你可以试试这个
box-shadow:
progid:DXImageTransform.Microsoft.dropshadow(OffX=0, OffY=10, Color='#19000000'),
progid:DXImageTransform.Microsoft.dropshadow(OffX=10, OffY=20, Color='#19000000'),
progid:DXImageTransform.Microsoft.dropshadow(OffX=20, OffY=30, Color='#19000000'),
progid:DXImageTransform.Microsoft.dropshadow(OffX=30, OffY=40, Color='#19000000');
回答by Kumar vaibhav
use this for fixing issue with shadow box
用它来解决阴影盒的问题
filter: progid:DXImageTransform.Microsoft.dropShadow (OffX='2', OffY='2', Color='#F13434', Positive='true');