我有以下样式来获得这种效果:
它在 IE9 和 Chrome 中有效,但在 IE8 中无效。我应该更改什么才能使其在 IE8 中工作。
请注意,我已将此样式应用于封装图像的标签。
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/