Spacing

Browsers collapse white space and wrap lines where they fit; white-space changes both: nowrap stops wrapping, pre preserves everything without wrapping, pre-wrap preserves and wraps, and pre-line keeps only newlines. CSS Text Level 4 made it a shorthand for white-space-collapse (Baseline 2024) and text-wrap-mode.

letter-spacing and word-spacing add or remove space, best in em. Give line-height a unitless number such as 1.5: children inherit the factor and apply it to their own font size, whereas 1.5em is computed once and inherited as a fixed length that cramps larger headings. text-indent indents the first line, and tab-size sets the tab width in preserved white space (default 8).

white-space, tab-size, letter-spacing, line-height and text-indentHTMLLive
<style>
  body { font: 15px system-ui; margin: 10px; }
  .code { white-space: pre-wrap; tab-size: 4; font-family: monospace; background: #eceff1; }
  .body { line-height: 1.6; text-indent: 2em; letter-spacing: .02em; margin: 4px 0; }
</style>
<div class="code">if (ok) {
&#9;return "tab-size: 4 keeps this indent narrow";
}</div>
<p class="body">A unitless line-height of 1.6 gives body copy room to breathe, and the first line
  is indented by 2em, the book style for paragraphs without a blank line between them.</p>
Browser output of Listing 4.35
Browser output of 35