← TechnologyThe essentials of

white-space: how to keep new lines in text

Publisher: ResumeMaker • 1 source

Published: 22 Oct 2026 13:13 · Updated: 22 Oct 2026 13:13

AI source check: 21 Oct 2026 10:36. This is not editorial approval.

In a few sentences

In brief

pre-wrap stores the spaces and new lines, and also allows for carryover.

Useful to know

white-space determines how the browser handles empty characters and porting. In the usual normal sequences of intervals contract . pre-wrap retains the intervals and explicit new rows, but allows the long rows to be carried according to the available width. [1]

This is appropriate for a short note entered as plain text: the author may have divided an address or instructions into lines. With pre-wrap, these divisions remain visible without each row receiving a separate HTML element.

Storage of whitespace does not imply authorization to execute HTML. The user text should be displayed with the correct escaping for the ; CSS application only solves the visual representation. If there is a very long address without spaces, check also a separate rule for carrying continuous strings, instead of expecting white-space to solve each case.

Sources

For further detail and to check the information:

  1. [1] MDN — white-space ↗