div半透明遮罩效果

2022-07-25 10:07:32

效果


<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('http://www.codefans.net/jscss/demoimg/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>
</body>
</html>




  • 作者:WeLoveSunFlower
  • 原文链接:https://blog.csdn.net/WeLoveSunFlower/article/details/38065105
    更新时间:2022-07-25 10:07:32