
I need the exact CSS snippet to making center position for child div into a parent div.

I need the exact CSS snippet to making center position for child div into a parent div.
You can do it like this, without the need to know the dimensions of either div:
<div class="container">
<div class="centered">
[...]
</div>
</div>
CSS:
.container {
position: relative;
}
.centered {
position: absolute;
// Center upper left corner
// Percentage is relative to width/height of parent container
top: 50%;
left: 50%;
// Move centered element so its center is centered
// Percentage is relative to width/height of centered element
transform: translate(-50%, -50%);
}