Overflow & truncation
When more text than fits lands in a box, text-overflow decides what happens to the excess: drop it
silently (clip) or mark the cut with an ellipsis (ellipsis). One property covers both kinds of
overflow — too many lines (block) and a line too wide (inline) — and it works on box-bound text:
<textArea> and <x:textbox>, not point text or inline-size flow (spec §6.6).
Attributes
| Attribute | Values | Default | Effect |
|---|---|---|---|
text-overflow | clip | ellipsis | clip | how overflow is resolved on box-bound text |
text-overflow is the unprefixed CSS/SVG 2 name. clip is the default and reproduces SVG Tiny 1.2
behavior.
The two overflow axes
- Block overflow — more wrapped lines than fit the content height.
- Inline overflow — a single line wider than the content width (an unbreakable token).
The pipeline
Overflow is resolved in a fixed order (spec §6.6):
- Resolve the font size — apply
fitfirst. - Wrap the text at that size.
- Count the fitting lines
C— the lines whose baseline lies within the content height (C= all lines ifheightisauto). - Apply
text-overflow.
A line is counted by its baseline, not its full ink band. So a line whose cap-top or descent merely grazes the edge still renders and visually overflows rather than vanishing — only a baseline past the box is genuine block overflow.
clip
Render lines 0 … C−1 and drop the rest. Inline overflow (and the ink of a grazing line) renders
past the box; a higher-quality backend may emit a clip path.
ellipsis
Render lines 0 … C−1; if lines were dropped, the last rendered line is ellipsized. Any rendered
line wider than the content width is also ellipsized. If C = 0, nothing renders.
Ellipsizing a line strips trailing whitespace, then trims trailing characters until the line plus
the