html - Two full height columns, one divided in two stacks with same height -
there 1 column on left-hand side , 1 on right-hand side. these columns have same height, created flexbox:
html
<div class="flex-container"> <div class="left flex-item">grounds rich pumpkin spice milk aftertaste doppio cream carajillo. espresso body iced rich caramelization brewed sit organic crema. qui grounds doppio wings ristretto barista cream brewed coffee aftertaste ristretto that. froth americano, french press , dark java brewed.grounds rich pumpkin spice milk aftertaste doppio cream carajillo. espresso body iced rich caramelization brewed sit organic crema. qui grounds doppio wings ristretto barista cream brewed coffee aftertaste ristretto that. froth americano, french press , dark java brewed.</div> <div class="right flex-item"> <div class="stack stack-top">stack</div> <div class="stack stack-below">stack</div> </div> </div> css
.flex-container { display: flex; } .flex-item { flex: 1 0; } .left, .right, .stack { border: 1px solid silver; } the column on right-hand side should divided vertically 2 stacks same height (50%). should dynamically height of column on left-hand side.
is there way flexbox , without using height property? (no need work in browsers)
yes, can make second flex item flexbox itself, , change direction column, apply flex: 1 child items.
html (no changes)
css
.flex-container { display: flex; } .flex-item { flex: 1 0; } .left, .right, .stack { border: 1px solid silver; } .flex-container > div:nth-child(2) { display: flex; flex-direction: column; } .flex-container > div:nth-child(2) > div { flex: 1; }
Comments
Post a Comment