图片/容器/字体 透明度[opacity:0.4; filter:alpha(opacity=40)]

1、字体透明度

<html>
<head>
    <style>
        #test{
                   }
        #test span{
            color:#fff;
            zoom:1 /*触发IE下块级元素*/
            filter:alpha(opacity=50);
            -moz-opacity:0.5;
            opacity:0.5;
        }
    </style>
</head>
<body>
    <div id="test">
        <span>前景色透明度</span>
    </div>
</body>
</html>

2、图片透明度

img
{
opacity:0.4;
filter:alpha(opacity=40); /* For IE8 and earlier */
}
img:hover
{
opacity:1.0;
filter:alpha(opacity=100); /* For IE8 and earlier */
}

3、容器透明度

.pxs_bg .pxs_bg2{
    background-image:url(../images/bg2.png);
    opacity:0.3;
    filter:alpha(opacity=30);
    /*left negative 1/4 of ww*/
}

posted @ 2017-02-03 14:26  小周同学  阅读(614)  评论(0编辑  收藏  举报