Posts

Showing posts with the label vertical-alignment

Flexbox fill available space vertically

Image
Clash Royale CLAN TAG #URR8PPP Flexbox fill available space vertically Now in a flexbox row I can write <div layout="row"> <div>some content</div> <div flex></div> <!-- fills/grows available space --> <div>another content</div> </div> I would like to achieve the same but vertically, like on this picture Currently the problem is that the div which would need to grow doesn't have any height so the two contents are below each other. I want my second content to be at the bottom of the parent container which have a fix height! I know I could solve this by positioning the second content absolute and bottom: 0; but can I achieve this with flexbox? bottom: 0; 2 Answers 2 So you can try this: flex-direction: column for the flex container. flex-direction: column flex: 1 for the element that needs to fill the remaining space. flex: 1 ...