HTML & CSS · Middle · Question 6 of 75
How does repeat(auto-fill, minmax(200px, 1fr)) differ from repeat(auto-fit, minmax(200px, 1fr))?
- 1
auto-fitdoesn't supportminmax(), so this declaration simply won't work - ✓Correct answer:
auto-fillkeeps empty columns, whileauto-fitcollapses them and stretches the items - 3No difference: they are synonyms kept for backward compatibility
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.