In CSS, the property display: flex; is used to create a flex container — a layout model that makes it easier to design flexible and responsive layouts.
🔹 Definition:
display: flex;
→ Turns the selected element into a flex container, and its direct children become flex items.
.container {
display: flex;
}
Default behavior:
The items align horizontally (row direction).
The container can adjust spacing and alignment automatically.
It helps create responsive layouts without using floats or positioning.
Top comments (0)