Interactive CSS reference tools with live previews, documentation, and code generation
Flexbox (Flexible Box Layout) is a one-dimensional layout method for arranging items in rows or columns. It provides an efficient way to distribute space and align content, even when their size is unknown or dynamic.
display: flexDefines the main axis direction
Aligns items along main axis
Aligns items along cross axis
Controls wrapping behavior
Spacing between flex items
.container {
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: stretch;
flex-wrap: nowrap;
gap: 10px;
}flex-direction
Establishes the main axis, defining the direction flex items are placed in the flex container.
•
justify-content
Defines alignment along the main axis and distributes extra space.
•
align-items
Defines how flex items are laid out along the cross axis.
•
flex-wrap
Controls whether items wrap to new lines when they exceed container width.
•
gap
Sets spacing between flex items. Replaces the need for margins on items. Supports px, rem, em, and % units.
justify-content: space-between for even spacingflex-wrap: wrap with gap for responsive gridsjustify-content: center and align-items: centerflex-direction: column with appropriate gapsalign-items: center to align icons and text