re: Centering in modern CSS VIEW POST


If you have just one child element to center, you can set flex on the parent and margin auto on the child.


Yeah, that's a very nice solution, too!

For myself, I like to use the container to take care of its inner layout. That's why I wrote about this approach.

Code of Conduct Report abuse