I am currently exploring the grid system and I have a specific challenge. I would like the third block to expand to its full width without the need for extra classes.
Can this be achieved using only internal CSS?
.grid {
margin: 36px auto;
height: 120px;
width: 100%;
display: grid;
grid-gap: 8px;
& > * {
border: dotted 2px black;
}
}
.first {
background-color: #6CD4FF;
grid-row: 1;
}
.second {
background-color: #8B8DF9;
grid-row: 1;
}
.third {
background-color: #DDFD77;
grid-row: 2;
}
<div class="grid">
<div class="first"></div>
<div class="second"></div>
<div class="third"></div>
</div>
<div class="grid">
<div class="first"></div>
<div class="second"></div>
</div>
<div class="grid">
<div class="first"></div>
<div class="third"></div>
</div>
My end goal is to achieve something similar to what you can see in this example image.