U
U
uzi_no_uzi2018-03-31 21:04:19
css
uzi_no_uzi, 2018-03-31 21:04:19

Why does FlexBox behave like this?

https://codepen.io/anon/pen/dmeMjz - Sandbox
Why do two menus go to a new line, although there is a place, if you remove the indents, then there is no such thing.
Screenshot of the problem:
5abfcd783c450263618669.jpeg
And another question, how to make two menus rebound from each other by the same distance without using margin? There is such a property as align-content: space-between, but it does not help (In the screenshot, this indent is made by margina
5abfcd947a1c9260481170.jpeg

Answer the question

In order to leave comments, you need to log in

2 answer(s)
H
holymotion, 2018-03-31
@holymotion

Everything works correctly, it goes because you have set the property of the flex container: flex-direction: column, respectively, they line up in a column, i.e. the axis changes

G
Glorious Cat, 2018-03-31
@tansur

Starting from the "nav" tag and moving up through the element's parents, set the width to 100%.
Space-between needs a fixed height (or min-height) to work. And yet, it is desirable to specify the appropriate properties for child elements (flex-basis, flex-grow, flex-shrink).
https://codepen.io/anon/pen/XEqjjB?editors=0100

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question