Flexbox
Flexbox is a CSS one-dimensional layout model for arranging, sizing, aligning, and distributing items along a row or column.
Tiny CSS Projects
Flexbox is a CSS layout model for aligning and distributing items along a single axis.
- How it is used
- Positions and aligns elements in profile cards, checkout layouts, forms, and small interface controls.
- How deep it goes
- Works through container alignment, spacing, and item sizing with CSS declarations, without descending into browser layout internals.
- Examples
- Uses a centered profile card, spaced statistics, a wide-screen checkout cart, and aligned credit-card details.
- What you can do after
- Operate/configure it to center elements, distribute row contents, and size adjacent sections with CSS Flexbox properties.
Web Design Playground
A page layout approach that uses CSS flexible box formatting to arrange and align items in a container.
- How it is used
- Arranges page components and small layouts so child elements can align, resize, and wrap as space changes.
- How deep it goes
- Works through container axes and alignment, item sizing, wrapping, and page examples, but stops short of older-browser prefix syntax.
- Examples
- Uses a centered heading, thumbnail list, holy-grail layout, photo gallery, and portfolio page.
- What you can do after
- Build it from scratch with CSS flex containers and item properties to arrange navigation, columns, thumbnails, and page sections.
Web Design Playground, Second Edition
Flexbox, or the CSS Flexible Box Layout module, arranges items along a single horizontal or vertical axis with flexible sizing and wrapping.
- How it is used
- Arranges page components along a horizontal or vertical axis, often alongside CSS Grid for overall layout.
- How deep it goes
- Works through container and item properties, centering, nested layouts, and projects; defers complex two-dimensional layouts to CSS Grid.
- Examples
- Uses a centered heading, a holy grail layout, a wrapping photo gallery, and a Grid-assisted portfolio.
- What you can do after
- Build it from scratch: center elements and assemble Flexbox-based page sections, including navigation, columns, and wrapping thumbnails.
Read how Web Design Playground, Second Edition explains flexbox →
Web Components in Action
CSS Flexbox is a one-dimensional layout model for arranging elements along a row or column with flexible sizing and alignment.
- How it is used
- Arranges a photo carousel’s headers, image area, and buttons vertically within a styled custom element.
- How deep it goes
- Demonstrates column direction and flexible remaining space, without developing a broader Flexbox model.
- Examples
- Uses a 500-by-300 photo carousel whose image container fills space between headings and navigation buttons.
- What you can do after
- Build it from scratch by applying column-oriented Flexbox and flexible sizing to a custom photo carousel.
CSS in Depth, Second Edition
Flex is a CSS display value that makes an element a flex container for its children.
- How it is used
- Arranges flex items in rows or columns, especially for equal-height layouts and alignment.
- How deep it goes
- Works through direction, sizing, nested containers, and alignment, while treating less-used spacing and ordering options as reference material.
- Examples
- Uses unequal-height tiles, a stylized price, and a navigation menu to show sizing and alignment choices.
- What you can do after
- Build it from scratch with `display: flex`, direction, gaps, sizing, and alignment; choose grid when cross-row alignment matters.
Build a Website with ChatGPT
Flexbox is a CSS layout model in which a container arranges and distributes its child items along a flexible one-dimensional layout.
- How it is used
- Uses CSS Flexbox to arrange navigation links, photo galleries, and portfolio cards instead of leaving them in a vertical stack.
- How deep it goes
- Explains containers, horizontal arrangement, distribution, centering, and wrapping, but defers deeper Flexbox mechanics.
- Examples
- Demonstrates navigation links, a wrapping photo gallery, and portfolio cards constrained between minimum and maximum widths.
- What you can do after
- Apply it via CSS or a precise ChatGPT prompt to build layouts that distribute items, wrap content, and adapt across screen sizes.
D3.js in Action, Third Edition
Flexbox is a CSS layout model for arranging elements along one or more flexible rows or columns.
- How it is used
- Organizes multiple visualizations and text into responsive dashboard layouts.
- How deep it goes
- Explains containers, rows, columns, wrapping, gutters, widths, and breakpoints with CSS and React examples.
- Examples
- Uses a rankings visualization, scatterplot, and bar chart arranged across desktop, tablet, and mobile layouts.
- What you can do after
- Build it from scratch by configuring containers, nested rows, flexible columns, gutters, and breakpoint-specific widths.
Also covered in
- Design for Developers
- Vanilla WebIn early access (MEAP)
- React Quickly, Second Edition
- Math for Web Design
- WordPress Power Toolkit: Harness AI to build next-level websites
- Pro Angular 16
What to know first
- CSSCSS (Cascading Style Sheets) is a stylesheet language for specifying the presentation and layout of structured documents.
- HTMLHTML is the standard markup language for structuring content and elements in documents on the web.
- digital imageA digital image is a digital representation of visual content, commonly encoded as an arrangement of pixels or other graphical elements.
- mainThe HTML main element identifies the dominant content of a document or application view, excluding shared navigation and peripheral content.
Related concepts
- align-itemsconfigured by · The CSS align-items property specifies how items are aligned along a container’s cross axis in flexbox and grid layouts.
- CSS Gridalternative to · CSS Grid is a CSS layout system for arranging elements in two-dimensional rows and columns.
- justify-contentconfigured by · The CSS justify-content property distributes flex items or grid tracks along the relevant container axis when free space is available.
- CSSused by · CSS (Cascading Style Sheets) is a stylesheet language for specifying the presentation and layout of structured documents.
- flexhas part · The CSS flex property is a shorthand that sets a flex item’s flex-grow, flex-shrink, and flex-basis values.
Questions about flexbox
What is flexbox?
Flexbox is a CSS one-dimensional layout model for arranging, sizing, aligning, and distributing items along a row or column.
Which Manning books explain flexbox?
Tiny CSS Projects, Web Design Playground, Web Design Playground, Second Edition, Web Components in Action, CSS in Depth, Second Edition, Build a Website with ChatGPT and D3.js in Action, Third Edition.
What should I know before learning flexbox?
Manning books that teach flexbox usually introduce CSS, HTML, digital image and main first.
What is the difference between flexbox and CSS Grid?
Flexbox is a CSS one-dimensional layout model for arranging, sizing, aligning, and distributing items along a row or column. CSS Grid is a CSS layout system for arranging elements in two-dimensional rows and columns.
What are the parts of flexbox?
Flexbox includes flex.
What is flexbox also called?
Flexbox is also called flex.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.






