CSS实现半透明div层的方法

时间:2022-03-08 19:28:13
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>半透明div</title>
<style>
#div1 { margin:0px auto; width:500px; height:370px ; text-align:center; background:url(wall3.jpg);}
#div2 {  height:330px; filter:alpha(Opacity=80);-moz-opacity:0.5;opacity: 0.5;z-index:100; background-color:#ffffff;  }
</style>
</head>
<body>
<div id="div1"> 
 <div style="padding:20px;"><div id="div2">这里是透明的DIV</div></div>
</div>
<div><A href="http://www.999jiujiu.com/"> http://www.999jiujiu.com/</A></div>
</body>
</html>