HTML DOM Style textOverflow 屬性
定義和用法
textOverflow 屬性規定當文本溢出包含它的元素,應該發生什麼。
瀏覽器支持
所有主流瀏覽器都支持textOverflow 屬性。
語法
返回textOverflow 屬性:
object .style.textOverflow
設置textOverflow 屬性:
object .style.textOverflow="clip|ellipsis|string|initial|inherit"
屬性值
值 | 描述 |
---|---|
clip | 默认值。裁剪文本。 |
ellipsis | 使用省略符号("...")来代表被裁剪的文本。 |
string | 使用给定的字符串来代表被裁剪的文本。 |
initial | 设置该属性为它的默认值。请参阅 initial 。 |
inherit | 从父元素继承该属性。请参阅 inherit 。 |
技術細節
默認值: | clip |
---|---|
返回值 | 字符串,表示元素的text-overflow 屬性。 |
CSS 版本 | CSS3 |
相關文章
CSS參考手冊: text-overflow屬性