css - 背景图像 + rgba() 在 IE 7-8 中具有后备功能

标签 css internet-explorer

我有一个具有背景图像和透明背景颜色的元素。我希望 IE 回退到纯色。

.element {
    background: url(image.png);
    background-color: #000; /* should be IE fallback */
    background-color: rgba(0,0,0,0.5);
}

这似乎是一个简单的问题,但我找不到任何解决方案。有些解决方案仅适用于 IE7,有些仅适用于 IE8。

最佳答案

试试这个:

.element {
    background: url(image.png);
    background-color: #000; /* IE 8 */
    background-color: rgba(0,0,0,0.5);
    *background-color: #000; /* IE 7 */
}

关于css - 背景图像 + rgba() 在 IE 7-8 中具有后备功能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13571855/

相关文章:

CSS - IE 不从最后一个 div 获取边距底部

html - Internet Explorer 7 CSS 问题

javascript - 在联系表上加载隐藏的 Div

html - 用于 wordpress 的嵌入式播放器和图像内容

css - IE水平滚动条自定义

html - Internet Explorer 中的 Twitter Bootstrap 崩溃问题

html - IE显示问题

html - 在图像( map )上自定义绝对定位的 FontAwesome 标记

css - 更改选项卡菜单背景颜色

css - 在可滚动的 div 中 flex 错误的高度