Intrinsic and extrinsic sizing
Definition and purpose
Intrinsic sizing uses the content to establish sizing constraints; extrinsic sizing uses the available space or externally supplied lengths. To isolate content widths, the examples use two breakable 80px inline-block boxes and zero font size to eliminate the space glyph.
Intrinsic minimum
<!doctype html><html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>CSS practice</title> <style> body { margin: 0; font: 16px sans-serif; color: #172033; background: white; } #parent { width: 140px; } .word { display: inline-block; width: 80px; height: 16px; background: #2563eb; } #a { font-size: 0; } #a { width: min-content; } </style> </head> <body> <div id="parent"> <div id="a"> <span class="word"></span> <span class="word"></span> </div> </div> </body></html>One probe fits per line; the minimum is 80px.
Syntax and mental model
For the inline axis of ordinary horizontal text, min-content allows all soft wrap opportunities; max-content avoids soft wrapping. With definite available space, fit-content clamps the stretch-fit size between the intrinsic minimum and maximum. Here the bounds are 80 and 160px and the available width is 140px, so fit-content yields 140px. Padding, borders, margins and min/max constraints can alter the final box.
Intrinsic maximum
<!doctype html><html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>CSS practice</title> <style> body { margin: 0; font: 16px sans-serif; color: #172033; background: white; } #parent { width: 140px; } .word { display: inline-block; width: 80px; height: 16px; background: #2563eb; } #a { font-size: 0; } #a { width: max-content; } </style> </head> <body> <div id="parent"> <div id="a"> <span class="word"></span> <span class="word"></span> </div> </div> </body></html>Both probes stay on one line, exceeding the parent width.
Common mistakes
Do not assume min-content means zero or max-content means the parent width. An unbreakable item can exceed available space. The boxes here are decorative measurement probes, not a recommendation to set readable text to zero size.
Practice and next steps
After trying the examples, complete the linked coding exercise and review questions. Predict the result before running your code. Prerequisite: Display contents and hidden boxes, Functional values and environment. Next lesson: Definite and indefinite sizes.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Intrinsic and extrinsic sizing — knowledge check
Five questions on intrinsic and extrinsic sizing.
Which width allows all soft wraps?
What is max-content here?
What is fit-content with bounds 80 and 160 and available 140?
What if available width is 60px with minimum 80px?
What is an extrinsic input?