background-image + rgba()在IE 7-8回退 [英] background-image + rgba() with fallback in IE 7-8

查看:149
本文介绍了background-image + rgba()在IE 7-8回退的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个有背景图片和透明背景颜色的元素。我想要IE回到纯色。

I've got an element that has background image and transparent background color. I want IE to fall back to solid color.

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

看起来像一个简单的问题,但我找不到任何解决方案。

Seems like a simple question, but I can't find any solution for it. Some solutions work only in IE7, some only in IE8.

推荐答案

请尝试以下操作:

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

这篇关于background-image + rgba()在IE 7-8回退的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆