CSS Internet Explorer 8 中的框阴影问题
我有一个关于 IE8 和 css 的问题。我从 msdn 中将代码粘贴到我的 css 中,
.shadow {-ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#000000')";}
我使用了这样的问题代码
布拉布拉
我对此有一个问题。我希望只有 DIV 有阴影,但“Bla Bla”也有阴影。
谁能建议一种方法来解决这个问题?
谢谢...
I have a question about IE8 with css. I pasted code in my css from msdn
.shadow {-ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#000000')";}
I used the problem code like this
<div class="shadow"> <p>Bla Bla</p> </div>
And i have a problem about that. I want only DIV has shadow but "Bla Bla" has shadow too.
Can anyone suggest a method to fix this issue?
Thanks...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您需要为元素指定背景颜色:
http://jsfiddle.net/UNKAc/14/
不要引用我的话,但是:我认为这是因为 IE 试图投射需要实体来投射阴影的光。由于您的 div 是透明的,唯一可以投射阴影的就是文本本身。
You need to specify a background color for your element:
http://jsfiddle.net/UNKAc/14/
Don't quote me on this but: i think this is because IE tries to cast a light that need a solid to drop a shadow. And since your div is transparent atm the only thing that can cast a shadow is the text itself.
您可以将
background-color: #fff
应用于您的div
,然后您将看不到文本绘制的阴影。但是,
过滤器
看起来不如CSS3 中的 box-shadow
。IE8 不支持
box-shadow
,但您可以使用 CSS3 PIE 来模拟它。You could apply
background-color: #fff
to yourdiv
, then you won't be able to see the shadow drawn by the text.However, the
filter
doesn't look as good asbox-shadow
from CSS3.IE8 does not support
box-shadow
, but you can emulate it with CSS3 PIE.我知道这已经是几周前的事了,但如果您仍在进行调整,那么您应该真正看看 CSS3 PIE。我的一位工作朋友向我展示了它,如果您可以依靠 JS 来实现这些类型的 IE 增强功能,那就太好了。
http://css3pie.com/documentation/pie-js/
I know this is a couple weeks old, but if you're still tweaking at all you should really look at CSS3 PIE. One of my friends here at work showed it to me and it's pretty great if you can rely on JS for these types of enhancements for IE.
http://css3pie.com/documentation/pie-js/