My objective is to have the div overlap the next row(s) without pushing them down when it increases in size.
I attempted to use position: absolute;
but this caused issues with the Grid Layout structure.
Preserving the shape of the grid is crucial to me and I want to ensure it remains intact.
.grid-container {
display: grid;
grid-template-columns: auto auto auto;
padding: 10px;
}
.grid-item {
background-color: rgba(255, 255, 255, 0.8);
padding: 20px;
font-size: 30px;
text-align: center;
}
.grid-item:hover {
background-color: #ffcccc;
height: 90px;
}
<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>