How can I color the black part around and between the cols
but not changing main
?
mainmainmainmain
col1col1col col2 //where I want to fill in background-color OUTSIDE of grid start/end
main
, col1
and col2
are inside of the class .form-container
. I would like to change the background color of col1
and col2
where it falls outside of the grid start/end without changing it's wrapper (form-container
). Currently, it inherits the color of its wrapper.
<header></header>
<main class="form-container">
<form class="booking-form"> main takes up 100% horizontally </form>
<div class="selection"> col-1 takes up about 80% horizontally </div>
<div class="booking-detail"> col-2 takes up about 20% horizontally </div>
</main>
.form-container {
display: grid;
grid-template-columns: repeat(24, 1fr);
}
.booking-form {
grid-column: 3 / span 20;
}
.selection {
grid-column: 3 / span 15; //how to color outside of 3 and 15 (from 0 to 2 and from 16 till end)
}
.booking-detail {
display: block;
grid-column: 19 / -2;
}
This is the most similar question but I don't think it applies here.