flexbox vertically split container in HALF

The accepted answer is not ideal for the use of flex properties, because it can all be done without the need for min-height or max-height

I’ve cleaned up the example fiddle and removed non-essential css styles to show which flex properties are being used here.

In order to get evenly spaced top/bottom divs, you need to either specify the proper value for flex-basis, or let flex work itself out. Assuming that the parent’s display is set to flex with a column orientation, the combined flex style can get us there easily:

.half-containers {
    flex: 1;
}

see more on flex styling and the flex-basis property

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)