Center My Div
Using Flexbox
Using Grid
If you're using Grid, just add the following css to the parent element.
.parent__div { display: grid; }
You need to add
margin: auto;
to your child's CSS.