html - IE8 的 CSS3 框阴影效果?

标签 html css internet-explorer-8

我有以下样式来获得这种效果:

它在 IE9 和 Chrome 中有效,但在 IE8 中无效。我应该更改什么才能使其在 IE8 中工作。

请注意,我已将此样式应用于封装图像的标签。

enter image description here

 border-collapse: separate !important;
 box-shadow: 0px 0.5px 11px 4px #888888;

最佳答案

IE8 本身不支持 box-shadow。您可以使用惊人的 CSS3 PIE图书馆。


但是请注意,这并不完全复制 box-shadow。主要是,如果您的图像具有任何透明度,则元素后面的阴影会泄漏:

The shadow shape rendered by PIE is, unlike other browsers, opaque in the area behind the element's background. This means that if your element has a transparent or semi-transparent background, the opaque shadow will show through. To avoid this you must [..] give the element a non-transparent background

参见:http://css3pie.com/documentation/supported-css3-features/#box-shadow

关于html - IE8 的 CSS3 框阴影效果?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10899745/

相关文章:

html - 有没有一种方法可以判断 IE7 是在标准模式还是 Quirks 模式下呈现页面

html - 将响应式 youtube iframe 嵌入页面中心

html - 媒体查询不适用于 Windows 服务器

javascript - 缩放背景图像以适合 ie8 窗口

javascript - 列出 IE8 中的所有 Array.prototype 函数-

html - 正文中的邮件链接和换行符

jquery - Facebook阻止了我的JSON请求

安卓透明白底黑边

javascript - 以编程方式将 IE8 设置为隐私浏览模式

jquery - 全屏覆盖打开时防止 body 在 iPhone 上滚动