<div class="parent">
<div class="child">
Hello relative !
</div>
</div>
.parent {
position: relative;
width: 300px;
height:300px;
background:red;
}
.child {
font-family: Arial;
display:flex;
justify-content:center;
align-items:center;
position: absolute;
width: 150px;
height: 150px;
background: white;
right: 5px;
top:5px;
box-shadow: 0px 4px 4px rgba(0,0,0,0.5)
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.