Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

background-image + rgba() with fallback in IE 7-8

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.

like image 362
Marvin3 Avatar asked Nov 26 '12 19:11

Marvin3


1 Answers

Try this:

.element {
    background: url(image.png);
    background-color: #000; /* IE 8 */
    background-color: rgba(0,0,0,0.5);
    *background-color: #000; /* IE 7 */
}
like image 112
Dmitry Semenov Avatar answered Sep 28 '22 15:09

Dmitry Semenov