CSS white-space Playground

Mrs. Yanti’s notice on the market board: set white-space and overflow-wrap, then a Range per character shows the spaces merged, the Enters kept, the lines the…

Why it matters

Pick wrong and text shows up differently from what was meant: a price label splits in two, a buyer’s order lines merge into one paragraph, or a price list lined up with spaces falls apart. pre-wrap is the answer for chat, textareas and code; nowrap for short labels.

The key idea

white-space is two decisions: what happens to spaces and Enters, and whether it may wrap

Common mistakes

Try it in this playground