CSS Flexbox

What is Flexbox?

Flexbox (Flexible Box) is a CSS layout model designed to make flexible and responsive layouts easier. It allows container elements to distribute space dynamically and align items efficiently in any direction.

Flex Container Properties

Flexbox Example

Below is a flex container with three flex items. The container uses justify-content: space-around; and align-items: center;.

1
2
3

Try experimenting with these properties to see how the layout changes.

Quiz: Test Your Knowledge

1. What does the display: flex; property do?




2. Which of the following values can be used with the justify-content property?



3. How do you align flex items vertically?