HTML & CSS · Middle · Question 4 of 75

How does flex-basis differ from width on a flex item in a row (flex-direction: row)?

Explanation

flex-basis sets the item's initial size along the main axis, from which grow and shrink are computed. With flex-basis: auto, width is used (or height in a column). With flex-direction: column, flex-basis applies to height rather than width - that's the key difference from width.

Further reading

Problem with a question

HTML & CSS · Middle · question 4

Test yourself

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

Take this quiz