How to stretch one line of flexbox?

I will reference this example: http://codepen.io/KenPowers/pen/CwoKc?editors=110

My desired result is (when the screen width is at least 800 pixels) stretches the middle “line”, so that the header is at the top and the footer is at the bottom. I would like to do this without adding HTML markup.

Currently, the example is displayed as such:

Render 1

Adding the following code:

html, body {
  width: 100%;
  height: 100%;
}

The results are as follows:

Render 2

Finally, installing max-heightfrom footerand headeronto something like this 50pxleads to the following:

Render 3

How can I make the middle line stretch to fill all the space on the page? I feel like I've tried all the possible combinations align-content, align-itemsand align-selfto no avail.

+4

Source: https://habr.com/ru/post/1533542/


All Articles