HTML & CSS · Middle · Question 6 of 75

How does repeat(auto-fill, minmax(200px, 1fr)) differ from repeat(auto-fit, minmax(200px, 1fr))?

Explanation

Both create as many columns as fit. The difference shows when there are fewer items than slots: auto-fill keeps the empty tracks, while auto-fit collapses them to zero and 1fr stretches the existing items. For cards that should fill the row, auto-fit is the usual choice.

Further reading

Problem with a question

HTML & CSS · Middle · question 6

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