html - 阴影在 IE 9 中看起来很糟糕

标签 html css

在互联网上查看如何为我的容器添加阴影我找到了我应用于我的 div 的代码

.boxShadow {
   -webkit-box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);  
   -moz-box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);
   -ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#000000')"; 
}

现在,这段代码使我的 div 在 chrome 和 Firefox 中看起来很棒 this is how it look in chrome and FF

但出于某种原因,这就是 IE 9 中的样子 this is how it's looks in IE 9

我知道 chrome 和 FF 的样式与 IE 不同,但我想知道为什么我的样式也会给 Angular 色添加阴影,有没有办法解决这个问题?谢谢你的帮助

最佳答案

用这个替换你的规则:

.boxShadow {
  -webkit-box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);  
  -moz-box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);
  box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);
}

要支持 IE 6、7 和 8,则添加一个 conditional包含此规则的 CSS:

.boxShadow {
  behavior: url(ie-css3.htc);
}

http://box-shadow.googlecode.com/files/ie-css3.htc下载ie-css3.htc .

关于html - 阴影在 IE 9 中看起来很糟糕,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7135953/

相关文章:

javascript - 当在边界外单击时,具有 onclick 事件的自定义元素会触发

html - 背景图像遮挡 a-href

html - 即使更改了 z-index, anchor 标记也不起作用

css - 在中心位置设置一个元素 css

html - 复选框点击不触发

html - 如何避免元素重叠

html - 单击纯 css 关闭下拉菜单

html - 文本和 GMaps 在 Bootstrap 中一起嵌入容器行

javascript - HTML 表单文件输入未与传递到服务器的参数正确关联 [Rails]

css - 为什么 bootstrap 不链接到我的 HTML