If I'm making a grid with a fixed size, with some cells/areas populated, is there a way to format the implicit empty cells? Or do I have to add <div>s for each cell?
.container {
display: grid;
grid-template-rows: repeat(3, 20px);
grid-template-columns: repeat(3, 20px);
gap: 1px;
}
.container>div {
background-color: #DDE;
outline: 1px #11E solid;
text-align: center;
}
<p>Minimal HTML:</p>
<div class="container">
<div style="grid-column: 1; grid-row: 1;">A</div>
<div style="grid-column: 2 / 4; grid-row: 2;">B</div>
<div style="grid-column: 3; grid-row: 3;">C</div>
</div>
<p>With explicit empty divs to create desired appearance:</p>
<div class="container">
<div style="grid-column: 1; grid-row: 1;">A</div>
<div style="grid-column: 2 / 4; grid-row: 2;">B</div>
<div style="grid-column: 3; grid-row: 3;">C</div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>

<div>'s.