CSS
🎯 What is word-spacing?
The word-spacing property is used to adjust the space between words in a text.
In other words, it controls how far apart words appear from each other, not letters.
This property helps create more readable, balanced, or visually spacious text layouts.
It is especially useful in titles, posters, and modern UI typography.
🔹 Basic Usage
p {
word-spacing: 10px;
}
➡️ In this example, 10px space is added between each word.
🔸 Values
1. normal
Uses the browser’s default spacing between words.
2. length
Sets custom spacing using units like px, em, or rem.
p {
word-spacing: 8px;
}
h1 {
word-spacing: 20px;
}
span {
word-spacing: -2px;
}
➡️ Positive values increase spacing, negative values reduce spacing.
3. initial
Resets the property to its default value (normal).
4. inherit
The element inherits the word-spacing value from its parent element.
💡 Summary Table
| Value | Description |
|---|---|
| normal | Default browser word spacing |
| length | Custom spacing (px, em, rem) |
| initial | Resets to default value |
| inherit | Inherits from parent element |
-
🧠 Summary
- The word-spacing property controls spacing between words.
- Key differences:
- letter-spacing → space between letters
- word-spacing → space between words
- This property is useful for typography, design balance, and readability.
