Have three questions:
.parent {
width: 200px;
height: 200px;
background-color: salmon;
border: 5px solid red;
}
.child {
width: 20px;
height: 20px;
background-color: yellow;
border: 2px solid blue;
border-radius: 50%;
}
.child:active {
width: 350px;
height: 350px;
transition: width 2s linear, height 2s linear;
}
<div class="parent">
<div class="child">
</div>
</div>
overflow: hidden
on parent div.display: grid
and place-items: center
. That is by far the easiest way to centre an element.