I have a map created using CSS grid layout. There may be an image on the left, text in the upper right and a button or link in the lower right.
In the code below, how can I make the green area take up as much space as possible and at the same time the blue area should take up as little space as possible?
Green should push the blue area as far as possible.
https://jsfiddle.net/9nxpvs5m/
.grid {
display: grid;
grid-template-columns: 1fr 3fr;
grid-template-areas:
"one two"
"one three"
}
.one {
background: red;
grid-area: one;
padding: 50px 0;
}
.two {
background: green;
grid-area: two;
}
.three {
background: blue;
grid-area: three;
}
<div class="grid">
<div class="one">
One
</div>
<div class="two">
Two
</div>
<div class="three">
Three
</div>
</div>
Run codeHide result
source
share