<div class="grid-container">
<div class="grid-item">1</div>
<div class="grid-item">2</div>
<div class="grid-item">3</div>
<div class="grid-item">4</div>
<div class="grid-item">5</div>
<div class="grid-item">6</div>
<div class="grid-item">7</div>
<div class="grid-item">8</div>
<div class="grid-item">9</div>
</div>
.grid-container {
width: 300px;
height: 300px;
display: grid;
grid-template-columns: auto auto auto;
place-items: center;
}
.grid-item {
background-color: silver;
width: 50px;
height: 50px;
display: flex;
justify-content: center;
align-items: center;
}