HTML & CSS · Senior · Question 25 of 75
How do min-content, max-content and fit-content differ as width values?
- 1They're synonyms for
0,100%andauto, added for readability - ✓Correct answer: Minimum by the longest word, width without wrapping, and capped
max-content - 3They're values for Grid tracks only and don't work on regular blocks
Explanation
These are intrinsic sizes that depend on content. width: fit-content is handy for fluid badges and buttons that shouldn't stretch to full width. In Grid they're used in track definitions: grid-template-columns: max-content 1fr.