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;
}

 

评论

此博客中的热门博文

通过Graphql成功地查询Contentful,以便在我的gatsby项目中访问和显示图像

Oracle忘了保存,Oracle Cloud甲骨文云服务器忘记SSH秘钥或未设置Public key的解决办法...

国外免费虚拟主机主要搭建网站