R
R
r_g_b_a2020-02-25 15:30:22
css
r_g_b_a, 2020-02-25 15:30:22

How is the height of flex items calculated?

Hello.
There is such an example https://jsfiddle.net/vLw6jh5x/
In the first case, all flex items take the height of the parent due to the align-items: stretch property;
In the second case, the height: 100% property is applied to them. It would seem that the result should be identical to the first one, but instead the height equals the content. Why is this happening?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
ThunderCat, 2020-02-25
@ThunderCat

the height: 100% property only works for nested elements with a parent of a given height, otherwise it just doesn't work. Actually, for this, in particular, they use flex.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question