Flexbox
CSS Flexbox is a one-dimensional layout model for arranging items along a main axis and a cross axis.
It is commonly used for navigation bars, button groups, alignment, centering and components whose items need flexible sizing or distribution.
One-axis layout with flexible items
It is commonly used for navigation bars, button groups, alignment, centering and components whose items need flexible sizing or distribution. In practical terms, Flexbox belongs to the presentation and layout layer. Knowing that layer is important because it tells you what the term can change, what it cannot change, and where to look when something behaves unexpectedly.
Distributing controls along a main axis
A toolbar can use display:flex with align-items:center and gap:12px to arrange controls along one main axis.
Where alignment and gap do the work
You do not need to memorize the term in isolation. It becomes useful when you can recognize it in the tool, browser, file or conversation where the concept is doing real work.
Flexbox and Grid solve different layout problems
CSS Flexbox is a one-dimensional layout model for arranging items along a main axis and a cross axis. By contrast, CSS Grid is a two-dimensional layout system for arranging content in rows and columns. The two can appear in the same project, but they describe different parts of the work and should not be used as interchangeable labels.
The mistake: forcing two-dimensional layouts into one axis
The common mistake is to use Flexbox as if it also meant CSS Grid. That blurs two separate decisions and usually sends troubleshooting in the wrong direction. A better test is practical: Identify the main axis, cross axis and whether items need wrapping before changing alignment properties.
Why flex sizing makes components adaptable
In day-to-day work, Flexbox matters when items need to align or distribute along one primary axis. The practical value is not the vocabulary itself; it is being able to identify the right control, file, setting or decision when the concept becomes relevant.
A toolbar can use display:flex with align-items:center and gap:12px to arrange controls along one main axis. That example is useful because it turns the definition into something you can recognize, test and discuss with other people working on the same project.
Related terms worth learning next
Sources and further reading
Use these references when you need documentation-level detail, specifications or product-specific behavior beyond the plain-English explanation above.