<div class="box1">
<div class="box2"></div>
</div>
.box1 {
width: 200px;
height: 200px;
background-color: skyblue;
position: absolute;
}
.box2 {
width: 100px;
height: 100px;
background-color: pink;
margin: auto auto;
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.