D
D
Drovosek012019-10-21 11:38:56
css
Drovosek01, 2019-10-21 11:38:56

Why does the flex container element not go beyond it?

There is an example of layout with wp-kama: https://jsfiddle.net/kamaev/57br2agm/
If, for example, when all elements have the flex-basis property set to auto, set the width of the first .itm1 element to 200% or 20000px, then it is stretched to the maximum free space in the container, but no more. Why is that?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xversus, 2019-10-21
@Drovosek01

With flex-basis: auto , the width of the elements is calculated from the width or, if width is not specified, from the width of the content. The first element can't take up the entire line because flex-wrap is nowrap by default, and there should be room for the rest of the elements too.
You can read more here: https://medium.com/@stasonmars/%D1%80%D0%B0%D0%B7%...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question