Latest web development tutorials

HTML DOM Style textOverflow property

Style Object Reference Style Objects

Examples

Change textOverflow properties:

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

try it"

Definition and Usage

textOverflow attribute specifies when the text overflows the containing element, what should happen.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support textOverflow property.


grammar

Back textOverflow properties:

object .style.textOverflow

Setting textOverflow properties:

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

Property Value

描述
clip 默认值。裁剪文本。
ellipsis 使用省略符号("...")来代表被裁剪的文本。
string 使用给定的字符串来代表被裁剪的文本。
initial 设置该属性为它的默认值。请参阅 initial
inherit 从父元素继承该属性。请参阅 inherit

technical details

Defaults: clip
return value String representing the text-overflow property element.
CSS version CSS3


related articles

CSS Reference: text-overflow property


Style Object Reference Style Objects