IE6不支持opacity半透明 BUG的解决方法

来源:互联网 发布:networking 上传数据 编辑:程序博客网 时间:2024/05/16 12:31

IE6不支持 opacity透明,因此本文为大家介绍下IE6 不支持opacity半透明 BUG的解决方法,具体实现示例如下:

<!DOCTYPE html><html>    <head>        <title></title>        <meta charset="utf-8"/>        <style type="text/css">            .container{background-color: red;position: relative;width:200px;height: 200px;}            .box1,.box2{width:100px;height: 100px; position: absolute;top: 0;left: 0;}            /* 兼容IE6+ */            .box1{background-color: rgba(2,2,2,0.5);background-color:rgb(2,2,2);opacity: 0.5;filter:alpha(opacity=50); }            .box2{color:#FFF;}        </style>    </head>    <body>        <div class="container">            <div class="box1"></div>            <div class="box2">sadas</div>        </div>    </body></html>

注意:当下面两个设置对应时 浏览器透明效果才会一致

filter:alpha(opacity=80); opacity:0.8;
0 0
原创粉丝点击