What is Flexbox in CSS?

Flexbox (Flexible Box Layout) is a CSS layout system to arrange items in a row or a column, and to align them and share the free space between them.

.container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

The parent is the flex container, and its children are flex items. See CSS Flexbox.


Learn more about the similar topics:
Tutorials
CSS Flexbox
CSS Grid
Exercises & Assignments
Write CSS to centre a div horizontally and vertically using Flexbox
Write CSS to create a three column layout using Flexbox
Write CSS to create a responsive card grid using CSS Grid
Interview Questions & Answers
What is Flexbox in CSS?
What is the difference between Flexbox and Grid?
How to center a div horizontally and vertically in CSS?