定位叠放顺序
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>定位堆叠顺序</title>
<style>
.box {
position: absolute;
top: 0;
left: 0;
width: 200px;
height: 200px;
}
.xiongda {
z-index: 1;
background-color: red;
}
.xionger {
z-index: 2;
background-color: green;
left: 50px;
top: 50px;
}
.guangtouqiang {
background-color: blue;
left: 100px;
top: 100px;
}
</style>
</head>
<body>
<div class="box xiongda">熊大</div>
<div class="box xionger">熊二</div>
<div class="box guangtouqiang">光头强</div>
</body>
</html>
效果展示
![在这里插入图片描述](https://img-blog.csdnimg.cn/8cf1a7cdb06647689bb6a48d6ae6eeb5.png?x-oss-process=image/watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBAV2FuZ1poYW5nXzUyMQ==,size_13,color_FFFFFF,t_70,g_se,x_16#pic_center)