Chapter 2

Getting Fancy with Flexbox

IN THIS CHAPTER

Bullet Getting to know Flexbox

Bullet Setting up your flex container

Bullet Aligning flex items

Bullet Centering stuff with Flexbox

Bullet Making flex items do your bidding

Flexbox is the first CSS layout technique that works for the modern web.

—PADDI MACDONNELL

Web design geeks use the term brittle to describe any page layout system that’s so baroque and overengineered that it works under only very constrained conditions and breaks when even some trivial aspect of those conditions changes. The opposite design philosophy can be described as a rigid page layout, where everything is coded in a way that nothing can possibly change no matter what device or screen or other variable you throw at the page.

What both brittle and rigid page layout designs lack is the simple and beautiful trait of flexibility. Rigid layouts have no flexibility whatsoever, whereas brittle layouts fall to pieces when even a tiny amount of flex is introduced. Web design geeks knew all that, ...

Get HTML, CSS, & JavaScript All-in-One For Dummies 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.