ie6-8透明背景色的问题

<style>
.test {
    filter: progid:DXImageTransform.Microsoft.Gradient(startColorStr=#80000000,endColorStr=#80000000); /* IE5.5 - IE8 */
    background: rgba(0, 0, 0, .5); /* 其他浏览器 */
    zoom: 1; /* 滤镜需要激活haslayout才能生效 */
}
:root.test {
    filter: none; /* IE9下需要关闭滤镜,否则会与背景色同时生效 */
}
</style>

<div class="test">此行的背景色为50%透明度的黑色</div>

posted @ 2017-08-17 15:23  一杯凉开水  阅读(129)  评论(0)    收藏  举报