私はCSSグリッドレイアウトで構築されたカードを持っています。左に画像があり、右上にテキストがあり、右下にボタンまたはリンクがある可能性があります。CSSグリッドのアイテムは残りのスペースを占有するには?
以下のコードでは、緑色の領域を可能な限り多くの領域を占有させ、同時に青色の領域を可能な限り小さな領域にする方法を教えてください。
緑色は、青色の領域をできるだけ下に押します。
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>
ないよう-が、それでも価値があるかもしれない質問への答え:私はフレキシボックスと '.two'と' .three'周りの追加のコンテナでそれを行うだろう。https://jsfiddle.net/ 9nxpvs5m/2/ – domsson