D
D
danforth2017-02-10 18:01:22
css
danforth, 2017-02-10 18:01:22

How to make flexbox push higher?

There is such a menu: prntscr.com/e6zkt2
The parent is set to:

display: flex;
flex-wrap: wrap;

I tried to do it flex-direction: columnand everything is fine, but there is a menu where there are few items, and instead of being located horizontally and not stretching the menu vertically, all the items fall out into a column and stretch the menu. prntscr.com/e6zqqb
The question itself in the picture: how to raise the elements up?
Or if I'm not doing it right at all: without bootstrap and flexbox, can I make an adaptive grid of menu items that will "push" up? If yes, how, give a tip.
PS By adaptability, I mean something for tablets and desktops, the mobile menu has already been set up.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander Pushkarev, 2017-02-10
@AXP-dev

Set column-count

-moz-column-count: 3;
    -webkit-column-count: 3;
    column-count: 3;

E
Egor Zhivagin, 2017-02-10
@Krasnodar_etc

align-items: flex-start;- Alignment along the secondary axis. By default, it stretches to the entire axis (stretch) UPD -
flex-start for the case withflex-direction: row;justify-content

V
Vladimir, 2017-02-10
@Casufi

I doubt that Flex can do that. It is possible to partially solve this problem with columns, but the question arises of transferring the contents of
codepen.io/casufi/pen/YNRQGR
frontender.info/a-guide-to-flexbox
https://habrahabr.ru/post/153925/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question