.parent-element { display: grid; place-items: center; }
.grid { display: grid; align-items: center; /* left and right */ justify-content: center; /* up and down */ }