z-index --- z-axis position:static --- does not work
/* z-index --- z-axis
position:static --- does not work
*/
INDEX.HTML:
<!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>CSS Tutorial</title>
<link rel="stylesheet" href="styles.css">
</head>
<body >
<div class="banner">
<img src="./iceland - 副本.jpg" class="one" alt="">
<img src="./detox.jpg" class="two" alt="">
<img src="./highway.jpg" class="three" alt="">
</div>
</body>
</html>
CSS:
/* z-index --- z-axis
position:static --- does not work
*/
img {
width: 100px;
height: 100px;
position: absolute;
}
.banner {
margin: 20px;
width: 70vw;
height: 70vh;
position: relative;
border: 5px solid red;
}
.one {
top: 0;
left: 0;
position: relative;
z-index: -3;
}
.two {
top: 10%;
left: 10%;
z-index: -1;
}
.three {
top: 20%;
left: 20%;
z-index: -2;
}
评论
发表评论