<div id="container">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
<div>7</div>
<div>8</div>
<div>9</div>
</div>
#container {
width: 200px;
height: 200px;
display: grid;
border: 2px solid purple;
grid-template-rows: repeat(3, 40px);
grid-template-columns: repeat(3, 40px);
grid-auto-rows: 40px;
justify-content: space-between;
align-content: space-around;
}
#container > div {
border: 1px solid grey;
text-align: center;
background-clip: content-box;
padding: 4px;
font-size: 20px;
background-color: greenyellow;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.