Style textOverflow Property
Examples
Change the textOverflow property:
document.getElementById("myDIV").style.textOverflow="ellipsis";
Try it Yourself »
Definition and Usage
The textOverflow property specifies how text should be displayed when it overflows its containing element.
Browser Support
![]()
All major browsers support the textOverflow property.
Syntax
Return the textOverflow property:
object.style.textOverflow
Set the textOverflow property:
object.style.textOverflow="clip|ellipsis|string|initial|inherit"
Property Values
| Value | Description |
|---|---|
| clip | Default value. Clips the text. |
| ellipsis | Uses an ellipsis ("...") to represent clipped text. |
| string | Uses the given string to represent clipped text. |
| initial | Sets the property to its default value. Seeinitial。 |
| inherit | Inherits the property from its parent element. Seeinherit。 |
Technical Details
| Default value: | clip |
|---|---|
| Return value | A string representing the text-overflow property of an element. |
| CSS Version | CSS3 |
Related Articles
CSS Reference:text-overflow property
Other Extensions
Style Object