I created a 12 column grid using the CSS grid. However, now I'm stuck with auto width (Auto expand until the end) class. Can anyone tell me is there any way or workaround to achieve it?
.box {background-color: #20262e; color: #fff; padding: 2rem;}
.row {
display: grid;
grid-gap: 1rem;
grid-template-columns: repeat(12, 1fr);
}
.col-6 {
grid-column-end: span 6;
}
.col-2 {
grid-column-end: span 2;
}
.col {
background-color: red !important;
/* ??? */
}
<div class="row">
<div class="box col-6">Parent A</div>
<div class="box col-6">
<div class="row">
<div class="box col-6">Child A</div>
<div class="box col-6">Child B</div>
</div>
</div>
<div class="box col-2">A</div>
<div class="box col">AUTO FILL</div>
<div class="box col-2">B</div>
</div>