leavlzi
8/8/2013 - 7:27 AM

透明层测试.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>透明测试</title>
<style>
*{
  margin:0;
	padding:0;
	font-size:12px;
}
body{
	text-align:center;
	background-color:#e3e3e3;
}
.bg{
	margin:0 auto;
	width:200px;
	height:200px;
	background-color:#ccc;
	position:relative;
	text-align:center
}
.bg .bg_p{
	position:absolute;
	bottom:0;
	left:0;
	width:100%;
	height:20px;
	z-index:20px;
	background-color:#fff;
	filter:alpha(opacity=30);
	opacity:0.3;
}
.bg p{
	position:absolute;
	bottom:2px;
	left:0;
	width:100%;
	color:#000;
}
</style>
</head>
<body>
<div class="bg">
	<div class="bg_p"></div>
	<p>这里的背景要透明</p>
</div>
</body>
</html>