XML technologies / CSS / Advanced websites with CSS / CSS property reference / text-overflow
(Excerpt from “CSS − Advanced websites with Cascading Stylesheets” by Rachel Andrew & Dan Shafer)
The property text-overflow is not included in the CSS specification and describes how an element handles overflowing text (see overflow). It affects only an element’s width (or its height for vertically written languages).
Since the property takes effect only when overflowing content is clipped, overflow must not be declared with visible.
Inherited: no
See also: overflow, white-space, width
Values
This property accepts either of the following constants:
clip: The text is clipped.ellipsis: The text is clipped and an(…)character is appended to the clipped section.
Default value: clip
Compatibility
CSS version: not part of the CSS specification
Works only in Internet Explorer for Windows from version 6.
Example
The following rule keeps text in table cells from wrapping as long as it fits. Otherwise, it is clipped and a (...) marker is appended:
td {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
Copyright © 2006 of the German translation, dpunkt.verlag GmbH
You may print the online version for your private use.
Otherwise, this chapter from “CSS − Anspruchsvolle Websites mit Cascading Stylesheets” is subject to the same conditions as the bound edition: the work, including all its parts, is protected by copyright. All rights reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
dpunkt.verlag GmbH, Ringstraße 19, 69115 Heidelberg