层叠属性(要在定位环境下使用) z-index
属性值:number
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
div{
position: fixed
}
div:nth-child(1){
width: 300px;
height: 300px;
background: pink;
z-index:1
}
div:nth-child(2){
width: 200px;
height: 200px;
background: green;
z-index: 2
}
div:nth-child(3){
width: 100px;
height: 100px;
background: orange
}
</style>
</head>
<body>
<div>金来</div>
<div>昕旭</div>
<div>胜平</div>
</body>
</html>
效果图 :