T
T
twin2322016-09-28 20:51:29
css
twin232, 2016-09-28 20:51:29

How to center a logo with flexbox?

I get the logo moving to the left when you insert menu blocks from the right. How to solve the problem? To keep the logo from floating back and forth? Here is the code itself:
.header { width: 1260px; margin: 0 auto; height: 350px; display:flex; justify-content: space-between; align-items: baseline; }4975633fbbe14159b1584478fe5b8429.png

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexey, 2016-09-28
@dzheka3d

This will not work with Flexbox, you either need to make a logo with absolute positioning, or blocks with buttons

R
Roman Romanenko, 2016-09-28
@Over9000

I think so https://jsfiddle.net/505r9d25/

D
Dmitry, 2016-09-29
@letehaha

What do you need? What would the logo be immediately to the left of the menu? Then set it to margin-left: auto;
A if you need the logo to always be on the right, regardless of the menu, then add either to it order: 1or to the rest of the elements, but don't add anything to the logo. I don't remember exactly how :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question