1.透明图层效果图
2.css
div.background
{
width: 100%;
background: url('images/z.jpg');
border: 1px solid red;
height:80px;
}
div.box
{
/* width: 100%; */
height: 60px;
align:center;
text-align:center;
margin:10px;
background-color: #ffffff;
border: 1px solid black;
filter:alpha(opacity=60);
opacity:0.4;
}
3.源代码
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<html>
<head>
<title></title>
</head>
<body topmargin="0" leftmargin="0">
<style>
div.background
{
width: 100%;
background: url('images/z.jpg');
border: 1px solid red;
height:80px;
}
div.box
{
/* width: 100%; */
height: 60px;
align:center;
text-align:center;
margin:10px;
background-color: #ffffff;
border: 1px solid black;
filter:alpha(opacity=60);
opacity:0.4;
}
</style>
<div class="background">
<div class="box">
</div>
</div>
</body>
</html>
注意事项:
border框会影响显示效果,可通过将border框设置为相同的背景颜色解决。