Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / CSS

word-spacing — additional spacing between words

The word-spacing property changes the spacing added to word separators, not the spacing between letters. It is inherited; normal preserves the spacing supplied by the font.

Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required

Syntax

word-spacing: normal | <length-percentage>;

word-spacing adds spacing to word separators remaining after white-space processing, including U+0020 SPACE and U+00A0 NO-BREAK SPACE. It does not replace the natural space width. The property is inherited, and its initial value is normal, meaning no additional spacing.

A positive length increases spacing, while a negative length decreases it; implementations may limit negative values. word-spacing: 0 does not remove natural spaces. Unlike letter-spacing, the property does not spread letters apart or create spacing where word separators are absent. A zero-width separator such as U+200B receives no additional spacing.

CSS Text Level 3 defines normal | <length>. The Level 4 draft expands the syntax to normal | <length-percentage>: a percentage is relative to the affected glyph’s advance width. It is inherited as a percentage, whereas an em length is inherited after conversion to an absolute length. A draft definition does not establish browser support; percentages require separate verification in the target Chromium 152 environment.

Examples

<!doctype html>
<meta charset="utf-8">
<title>word-spacing</title>
<style>
  .sample {
    display: inline-block;
    font: 20px monospace;
    white-space: pre;
    word-spacing: 0;
  }
  #wide { word-spacing: 8px; }
</style>
<div><span class="sample" id="base">one two three</span></div>
<div><span class="sample" id="wide">one two three</span></div>
<pre id="result"></pre>
<script>
  const base = document.getElementById('base');
  const wide = document.getElementById('wide');
  const difference = wide.getBoundingClientRect().width
    - base.getBoundingClientRect().width;
  document.getElementById('result').textContent =
    `Width difference: ${Math.round(difference)}px`;
</script>

Result

Width difference: 16px

The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version. The example uses pixel values and does not test percentage behavior.

Sources