Flexbox is Your Layout Superpower

If you’re still struggling with floats, it’s time to master Flexbox. It is the most reliable way to create responsive layouts.

1. The Perfect Center

With display: flex; justify-content: center; align-items: center;, you can center any element in three lines.

2. Margin Auto Trick

Use margin-left: auto to push a specific flex item to the far right of a container.