A
A
akokin2018-03-23 22:28:02
css
akokin, 2018-03-23 22:28:02

How to center an inline-flex container?

Friends, I can't figure out how to position the container itself in the center of the page?
Setting the inline-flex property to a container aligns it to the left edge. And it should be in the middle.
Maybe there is another solution?
The problem is that I need to wrap this container with colored borders so that I get a kind of block in the center of the page.
Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
Froggyweb, 2018-03-23
@Froggyweb

Give the wrapper property text-align: center;
in this case flexbox behaves like an inline element

S
Shadobut, 2018-03-23
@shadobut

margin: 0 auto ?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question