1.z-index只有在div是 position: absolute;绝对定位的条件下才能使用。
<html>
<head>
<style type="text/css">
.div1
{
position:absolute;
left:0px;
top:0px;
z-index:1;
background:green;
height:70px;
width:300px;
}
.div2
{
position:absolute;
left:20px;
top:20px;
z-index:2;
background:yellow;
height:70px;
width:100px;
}
.div3
{
position:absolute;
z-index:3;
left:40px;
top:40px;
font-weight:bold;
background:red;
}
</style>
</head>
<body>
<div class="div1">第一层</div>
<div class="div2">第二层</div>
<div class="div3">第三层</div>
</body>
</html>