z-index
用于设置绝对定位元素,层叠顺序
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<style type="text/css">
div{
width: 200px;
height: 200px;
}
.demo1{
background: gray;
position: absolute;
left: 50px;
z-index: 4;
}
.demo2{
background: green;
position: absolute;
z-index: 5;
}
</style>
</head>
<body>
<div id="demo">
<div class="demo1">a</div>
<div class="demo2">b</div>
</div>
</body>
</html>