<div class="father">
<div class="son">
</div>
</div>
/* .father{
overflow: hidden;
height: 100px;
width: 100px;
background-color: royalblue
}
.son{
height: 30px;
width: 30px;
background-color: hotpink;
margin: 0 auto;
margin-top: 35px
} */
/* .father{
height: 100px;
width: 100px;
background-color: royalblue;
position: relative
}
.son{
height: 30px;
width: 30px;
background-color: hotpink;
position: absolute;
left: 50%;
top: 50%;
margin-left: -15px;
margin-top: -15px;
} */
.father{
height: 100px;
width: 100px;
background-color: royalblue;
position: relative
}
.son{
height: 30px;
width: 30px;
background-color: hotpink;
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
margin: auto;
}