I have a grid element with a set number of rows and columns that has one more element than rows * columns. I'm trying to overlap this extra item on top of one of the cells (changes overtime) but the whole layout shifts whenever I try to set a specific row/column on the extra cell.
.grid {
display:grid;
width: 60px;
height: 60px;
grid-template-rows: repeat(2, 1fr);
grid-template-columns: repeat(2, 1fr)
}
.cell {
width: 30px;
height: 30px;
background: grey;
box-sizing: border-box;
}
<div class="grid">
<div class="cell">1</div>
<div class="cell">2</div>
<div class="cell">3</div>
<div class="cell">4</div>
<div class="cell extra">5</div>
</div>
results in something like
but when I set a specific row and column via:
.extra {
grid-row: 1/2;
grid-column: 1/2;
}
I get the following
but what I actually want


