concept

intrinsic-sizing — CSS reference

Intrinsic sizing derives dimensions from content rather than assigning a size from the surrounding space. In an inline axis, soft wrap opportunities separate the widest unbreakable segment from the full unwrapped extent. The content can still overflow if it has no suitable breaks.

Formal Syntax & Structure

css syntaxcss
min-content | max-content

Working Example

Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>CSS sizing and overflow lab</title><style>body {margin:0} .sample {background:#dcebe9;color:#182e32}#p{width:100px} #a,#b{font-size:0} span{display:inline-block;width:70px;height:20px} #a{width:min-content} #b{width:max-content}</style><body><div id="p"><div id="a" class="sample"><span></span><wbr><span></span></div><div id="b" class="sample"><span></span><wbr><span></span></div></div></body></html>
CSS Reference