背景色的半透明

来源:互联网 发布:日本j2联赛网络直播 编辑:程序博客网 时间:2024/03/29 13:40
第一种:
.content{
background-color: #000000;
/* other browsers */
opacity: 0.4;
/* this works in IE6, IE7, and IE8 */
filter: progid:DXImageTransform.Microsoft.Alpha(opacity=40); 
/* this works in IE8 only */
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=40)";

}

第二种:
第一种有个弊端就是当前类下的所有元素都会透明
.content .content_page {
float: right;
width: 738px;
margin-right: 6px;
_margin-right:3px;
    background:rgba(0, 0, 0, 0.4) none repeat scroll 0 0 !important;/*实现FF背景透明,文字不透明*/
filter:Alpha(opacity=40);
background:#000000;/*实现IE背景透明*/
}
.content_page img,dt,dd{ position:relative;}/*具体是实现内容不透明*/

第三种:

是我在网上找的,是别人在做的,在网站直接转色

http://www.linxz.de/demo/hex_color.html

0 0