IE8 gradient filter not working if a background color exists

前端 未结 9 2222
梦毁少年i
梦毁少年i 2020-12-28 08:53

I\'m trying to use the following CSS styles. They are working on most browsers, including ie7. However in ie8, the transparent background does not show and instead I get th

9条回答
  •  暖寄归人
    2020-12-28 09:25

    You're using Modernizer wrong. Modernizer places classes on the HTML element; not each individual element. Here's what I used in IE8 to color the SECTION tags.

    .rgba section {
        background-color: rgba(200, 0, 104, 0.4);
    }
    .no-rgba section {
        background-color: #B4B490;
    }
    .no-cssgradients section {
        filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#99B4B490',EndColorStr='#99B4B490');
        -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorStr='#99B4B490',EndColorStr='#99B4B490')";
        zoom: 1;
    }
    

提交回复
热议问题