How To Create Equal Height Columns With Flexbox

Using flexbox it only takes two rules to create even height columns in CSS, even if your content is different for each of them:

.columns {
    display: flex;

    .column {
        flex: 1;
    }
}
flex-columns.scss
Copied to clipboard!

There are also other ways to achieve the same effect. For example, by using grid, again, you need two rules:

.columns {
    display: grid;
    grid-auto-flow: column;
}
grid-columns.scss
Copied to clipboard!

And the same can be done using tables as well:

.columns {
    display: table;

    .column {
        display: table-cell;
    }
}
table-columns.scss
Copied to clipboard!
How To Create Equal Height Columns With Flexbox
If you would like to see more Webtips, follow @flowforfrank

Resource

Remove ads
Remove ads

๐Ÿ“š Get access to exclusive content

Want to get access to exclusive content? Support webtips with the price of a coffee to get access to tips, checklists, cheatsheets, and much more. โ˜•

Get access Support us
Remove ads Read more on
Remove ads
Remove ads
๐ŸŽ‰ Thank you for subscribing to our newsletter. x This site uses cookies We use cookies to understand visitors and create a better experience for you. By clicking on "Accept", you accept its use. To find out more, please see our privacy policy.