Z-Index
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="style.css">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Z index</title>
</head>
<body>
<div id="one">1</div>
<div id="two">2</div>
</body>
</html>
CSS
div{
height: 75px;
width: 75px;
}
#one{
background-color: aquamarine;
border: 2px solid black;
position: relative;
z-index:2;
}
#two{
background-color: bisque;
border: 2px solid black;
position: relative;
bottom: 20px;
z-index: 1;
}
z-index:1;
}
#two{
z-index:2;


Comments
Post a Comment