CKTIS / CSS
text-overflow — indicating overflowing text
The text-overflow property controls how content extending beyond a line edge is presented: clipping or an ellipsis. It does not constrain the width or create overflow by itself.
Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
Syntax
text-overflow: clip | ellipsis;
/* CSS Overflow Level 4 draft: */
text-overflow: [ clip | ellipsis | <string> | fade | <fade()> ]{1,2};text-overflow controls the presentation of inline content overflowing a line in a block container whose overflow is other than visible. Its initial value is clip; the property is not inherited.
clip cuts off content, potentially through a character. ellipsis reserves room for an ellipsis, normally … (U+2026), hiding the necessary content. It changes presentation, not the source text or layout. If space is insufficient, the marker itself may be clipped.
For the usual single-line case, combine a constrained width, overflow: hidden, white-space: nowrap, and text-overflow: ellipsis. The property alone neither prevents wrapping nor limits the number of lines. A single value affects the line end: normally the right edge for direction: ltr, the left for direction: rtl.
The CSS Overflow Level 4 draft adds <string>, fade, fade(), and a two-value form: line-left edge, then line-right edge, not directional start and end. These are draft extensions, not a browser-support guarantee; verify them separately in the target environment.
Examples
<!doctype html>
<html lang="en">
<meta charset="utf-8">
<title>text-overflow</title>
<style>
.sample {
width: 12ch;
overflow: hidden;
white-space: nowrap;
font: 20px/1.5 monospace;
direction: ltr;
border: 1px solid;
}
.clip { text-overflow: clip; }
.ellipsis { text-overflow: ellipsis; }
</style>
<body>
<p class="sample clip">ABCDEFGHIJKLMNOPQRSTUVWXYZ</p>
<p class="sample ellipsis">ABCDEFGHIJKLMNOPQRSTUVWXYZ</p>
</body>
</html>Result
Two bordered single-line boxes: the first clips the alphabet at the right edge; the second shows a shortened prefix followed by an ellipsis. The exact visible prefix depends on font metrics.
The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.