HTML & CSS · Junior · Question 28 of 75

A container has display: flex; flex-direction: column; justify-content: center. How are its children aligned?

Explanation

With flex-direction: column the main axis becomes vertical, so justify-content: center centers items vertically. Horizontal alignment is controlled by align-items in this case. The effect is visible only if the container is taller than its content.

Further reading

Problem with a question

HTML & CSS · Junior · question 28

Test yourself

Take the HTML & CSS · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz