Style textOverflow attribute

Definition and usage

textOverflow Specifies what should happen when text overflows the containing element.

See also:

CSS Reference Manual:text-overflow attribute

Example

Change textOverflow attribute:

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

Try it yourself

Syntax

Return textOverflow attribute:

object.style.textOverflow

Set textOverflow attribute:

object.style.textOverflow = "clip|ellipsis|string|initial|inherit"

Attribute value

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

Technical details

Default value: clip
Return value: string representing the text-overflow attribute
Version CSS : CSS3

Support du navigateur

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support Support Support Support Support