IE8 gradient filter not working if a background color exists

前端 未结 9 2216
梦毁少年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条回答
  •  萌比男神i
    2020-12-28 09:14

    #element {  
        background: -moz-linear-gradient(black, white); /* FF 3.6+ */  
        background: -ms-linear-gradient(black, white); /* IE10 */  
        background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #000000), color-stop(100%, #ffffff)); /* Safari 4+, Chrome 2+ */  
        background: -webkit-linear-gradient(black, white); /* Safari 5.1+, Chrome 10+ */  
        background: -o-linear-gradient(black, white); /* Opera 11.10 */  
        filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#000000', endColorstr='#ffffff'); /* IE6 & IE7 */  
        -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr='#000000', endColorstr='#ffffff')"; /* IE8+ */  
        background: linear-gradient(black, white); /* the standard */  
    }  
    

提交回复
热议问题