More "Try it Yourself" examples below.
The text-overflow property specifies what should happen when text overflows the containing element.
| Default value: | clip |
|---|---|
| Inherited: | no |
| Animatable: | no. Read about animatable |
| Version: | CSS3 |
| JavaScript syntax: | object.style.textOverflow="ellipsis" Try it |
The numbers in the table specify the first browser version that fully supports the property.
Numbers followed by -o- specify the first version that worked with a prefix.
| Property | |||||
|---|---|---|---|---|---|
| text-overflow | 4.0 | 6.0 | 7.0 | 3.1 | 11.0 9.0 -o- |
| Value | Description | Play it |
|---|---|---|
| clip | Default value. Clips the text | Play it » |
| ellipsis | Render an ellipsis ("...") to represent clipped text | Play it » |
| string | Render the given string to represent clipped text | |
| initial | Sets this property to its default value. Read about initial | Play it » |
| inherit | Inherits this property from its parent element. Read about inherit |
Text-overflow with a hover effect
This example demonstrates how to display the entire text when hover over the
element.
CSS3 tutorial: CSS3 Text Effects
HTML DOM reference: textOverflow property