5
Implementing Layouts with Flexbox and CSS Grid
We can now almost consider ourselves experts in the usage of CSS Grid. We’ve looked at many details, practiced many aspects of the tool, and learned about different approaches to creating grids and how to design them. As a result, we now know what we can achieve with CSS Grid.
However, CSS knows another versatile and powerful tool for building layouts: Flexbox. Since Flexbox was first announced – I still remember that day – people have used it to replace all kinds of hacks and fixes. From vertically centering icons (remember this gem to center something in its container? top: 50%; left: 50%; transform: translate (-50%, -50%); — I’m shuddering while writing this…) to building entire pages, everything ...
Get Mastering CSS Grid now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.