Hi, I’m trying to position the element absolutely relative to the other element but I’m unable to do it. I’m not getting the error. Please help.
The following is my code. Iam trying to postion the div.absolute element on the div.container element
<!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>Practice</title>
</head>
<body>
<div class="container">
<div class="item">hey</div>
<div class="item">today</div>
<div class="item">bottom</div>
</div>
<div class="absolute">
</div>
</body>
<style>
*{
padding:0;
margin:0;
box-sizing:border-box;
}
.container{
position:relative;
background:red;
margin-top:70px;
}
.absolute{
position:absolute;
top:0;
left:0;
bottom:0;
right:0;
height:50px;
width:150px;
background:burlywood;
}
</style>
</html>