仅仅只是设置背景色透明,CSS如下:
.testdiv{
position: fixed;
z-index: 1;
top:60px;
left:295px;
height: 40px;
border: 0;
margin: 0;
padding: 0;
z-index: 2;
[b][color=red]background-color: none;
background-color: transparent; /*效果同none*/[/color][/b]
}
如果是设置整个div是透明背景,CSS如下:
.testdiv{
position: fixed;
z-index: 1;
top:60px;
left:295px;
height: 40px;
border: 0;
margin: 0;
padding: 0;
z-index: 2;
background-color: rgb(255, 255, 255);
[color=red][b]filter:alpha(opacity=20); /*ie透明度20%*/
-moz-opacity:0.8; /*Moz + FF 透明度20%*/
opacity:0.8;[/b][/color] /*支持CSS3的浏览器(FF1.5也支持)透明度20%*/
}
.testdiv{
position: fixed;
z-index: 1;
top:60px;
left:295px;
height: 40px;
border: 0;
margin: 0;
padding: 0;
z-index: 2;
[b][color=red]background-color: none;
background-color: transparent; /*效果同none*/[/color][/b]
}
如果是设置整个div是透明背景,CSS如下:
.testdiv{
position: fixed;
z-index: 1;
top:60px;
left:295px;
height: 40px;
border: 0;
margin: 0;
padding: 0;
z-index: 2;
background-color: rgb(255, 255, 255);
[color=red][b]filter:alpha(opacity=20); /*ie透明度20%*/
-moz-opacity:0.8; /*Moz + FF 透明度20%*/
opacity:0.8;[/b][/color] /*支持CSS3的浏览器(FF1.5也支持)透明度20%*/
}