Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Style textOverflow property

Style textOverflow property

Style Object Reference The Style object

Example

Change the textOverflow property:

document.getElementById("myDIV").style.textOverflow="ellipsis";

Try it »


Definition and Usage

The textOverflow property specifies how text should be displayed when it overflows the element that contains it.


Browser support

Internet Explorer Firefox Opera Google Chrome Safari

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"

Attribute values

Value Description
clip Default. Clips the text.
ellipsis Use an ellipsis ("...") to represent the clipped text.
string Use a given string to represent the clipped text.
initial Sets this property to its default value. See initial.
inherit Inherits this property from its parent element. See inherit.

Technical Details

Default value: clip
Return Value A string, representing the text-overflow property of an element.
CSS version CSS3

Related Articles

CSS Reference Manual:text-overflow property


Style Object Reference The Style object