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">
<link name="favicon" type="image/x-icon" href="https://skillzam.com/uploads/system/e353194f3b7cd1b75d69c3ab88041985.png" rel="shortcut icon" />
<title>Z-Index</title>
<style>
.football {
position:absolute;
z-index: -1;
}
.doggy {
position:absolute;
z-index: 0;
}
.skillzam {
position: absolute;
z-index: 1;
}
</style>
</head>
<body>
<!--
z-index property specifies the stack order of an element.
z-index only works on positioned elements:
- position: absolute
- position: relative
- position: fixed
- position: sticky
- flex items
-->
<h1>Demo: Z-Index </h1>
<img class="skillzam" src="/notes/examples/assets/img/skillzam.png" alt="skillzam logo" style="width:40%" title="Image#1">
<img class="doggy" src="/notes/examples/assets/img/doggy.png" alt="doggy Photo" style="width:100%" title="Image#1">
<img class="football" src="/notes/examples/assets/img/football.jpg" alt="football black & White" style="width:100%" title="Image#1">
</body>
</html>