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

HTML DOM Style tabSize Property

Style tabSize Property

Style Object Reference The Style object

Example

Sets a

 元素的 tabSize:

document.getElementById("myPRE").style.tabSize="16";

尝试一下 »


定义和用法

tabSize 属性Specifies制表符(tab)字符的空格长度。

在 HTML 中,制表符(tab)字符通常显示为一个单一的空格字符,除了一些元素,比如


语法

返回 tabSize 属性:

object

.style.tabSize

设置 tabSize 属性:

object

.style.tabSize="

number

|

length

|initial|inherit"

属性值

值描述
number默认值是 8。Specifies每个制表符(tab)字符要显示的空格字符的数量。
lengthSpecifies制表符(tab)字符的长度。几乎所有的主流浏览器都不支持该属性值。
initial设置该属性为它的默认值。See also initial。
inherit从父元素继承该属性。See also inherit。

技术细节

默认值:8
返回值:字符串,表示元素的 tab-size 属性。
CSS 版本CSS3

相关文章

CSS 参考手册:tab-size 属性


Style Object Reference Style 对象