Centering with a field: 0 cars; vs. justify-content and flexbox

By doing some elements of the horizontal html center, I just realized that I can use both things to center the box element in my parent, so my question is which of the two is better (in terms of performance, convenience, etc.).

+4
source share
2 answers

If you use divor p, it is better to use margin: 0px auto;for containers or the main page, but if you need to focus on two or more children, it is better to set the parent element text-align:center, and for children - display: inline-block.

+2
source

- , flex, .

, , div, flex ". div ', margin:auto. , flexbox .

0

All Articles