text-overflow CSS property determines how the text content will be displayed, when it overflows the block container element that has
overflow other than
The following table summarizes the usages context and the version history of this property.
|Applies to:||Block containers|
|Animatable:||No. See animatable properties.|
|Version:||New in CSS3|
Note:Text can overflow, when it is prevented from wrapping e.g. due to white space set to nowrap for the containing element or a single word is too long to fit.
The syntax of the property is given with:
The example below shows the
text-overflow property in action.
ExampleTry this code »
The following table describes the values of this property.
||Clip text as appropriate for the text content. Characters may be only partially rendered.|
||Render an ellipsis character ('...', U+2026) to represent clipped text.|
|string||Render the given string to represent clipped text. The string is displayed inside the content area, shortening more the size of the displayed text. If there are not enough places to display string, they are clipped.|
||Sets this property to its default value.|
||If specified, the associated element takes the computed value of its parent element
text-overflow property is supported in all major modern browsers.
Note:Internet Explorer supports the prefixed version
-ms-text-overflow that can be used as a synonym for
text-overflow. Opera 9 and 10 supports the prefixed version,