Flexbox

If you’re building more of an app than a content-rich website, especially if you’re building an app with lots of buttons and options in the UI, or with lots of form elements or interactive regions, you’ll find the Flexible Box (Flexbox) module extremely useful.

The roots of Flexbox are in XUL, the language used to create the Firefox browser’s layout, which should tell you that it’s aimed at user interfaces. Flexbox makes elements resize flexibly to better fit their available space and reorders them or changes their orientation quickly.

The Flexbox syntax has undergone an awful lot of changes in the past few years, but it’s finally quite stable and well implemented, so we can discuss it without worry!

Declaring the Flexbox Model

Get The Modern Web 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.