Mr. Karim’s signboard rack: your words cut by every rule at once, auto, min-content, max-content, fit-content and grid tracks, and the browser measures each…
Chips, badges and buttons that fit their text, with no hardcoded number that breaks when the text gets translated. It is also the key to mysterious horizontal scroll: there is almost always content whose min-content is wider than its parent (a URL, a long word, nowrap), and 1fr or a flex item refuses to shrink below it.
The browser measures two numbers from the content: min-content and max-content. Every keyword is a rule on those two numbers.
white-space: nowrap text. In a plain block the box stays parent-wide and the content spills. A grid/flex item is sneakier: its built-in minimum auto = min-content, so the item itself widens and breaks through. Put overflow-wrap: anywhere on the content (it shrinks min-content), or minmax(0, 1fr) / min-width: 0 on the item, then wrap the text.width: right for "New", too tight for "Sonderangebot", and a word that cannot break spills out. Use width: fit-content: the width is measured from the text, however long, and still capped by the parent.overflow-wrap: anywhere or word-break: break-all.overflow-wrap: break-word, the grid/flex item still breaks through break-word breaks a word only when its line really overflows, and those break points are not counted in min-content. So 1fr and flex items still treat the URL as one whole piece. Use overflow-wrap: anywhere (counted in min-content), or drop the minimum: minmax(0, 1fr) / min-width: 0.min-content sign sticks out min-content ignores the parent: it's as wide as the longest piece. When the parent is narrower, the sign sticks out past the post instead of shrinking.max-content, then look at fit-content max-content sticks out. fit-content stops right at the post and the words wrap.overflow-wrap: anywhere min-content drops from the URL's width to one letter's. Compare break-word, whose number stays put.