H
H
Haykeloff2020-05-02 06:43:05
css
Haykeloff, 2020-05-02 06:43:05

Align item not working inside flex container, why?

Trying to make up the header of the site, I came across an interesting effect ( Code ). I tried to make a flex item into a flex container, but align-items stopped working for .header-container . That is, the .logo and .menu elements are no longer centered vertically. If display: flex is removed from .menu, then the elements will begin to be centered, but why this happens, I have no idea.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Pastukhov, 2020-05-02
@Haykeloff

align-items works for you. Just either remove the height from the logo, or center the logo in the container

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question