I have a div with n (can be different number) children. I want to display them in one row and center horizontally.
In flex, I would do:
display: flex;
justify-content: center;
How is it possible to do it with grid, without flex?
.a {
height: 20px;
width: 20px;
background: blue;
border: 1px solid red;
}
.b {
display: grid;
gap: 20px;
}
<div class="b">
<div class="a">x</div>
<div class="a">x</div>
<div class="a">x</div>
<div class="a">x</div>
</div>