<div class="container"> <div class="child"></div> </div> .container { ... display: flex; justify-content: center; align-items: center; }