there’s no place like code

word-break-inside: avoid kind of deal

Originally posted at saji-codes tumblr.

See 2023 update.

I’ve spent some time looking for something like word-break-inside: avoid (sort of an opposite to <wbr /> — a way to avoid breaking words in a inline element, but do that, if it’s longer than a line, just like page-break-inside: avoid does for pages in print). Turns out there’s none.

Just seemd that’s it’s too trivial thing to use JavaScritpt for that. But actually you can do just that using display: inline-block.