English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
CSS tab attribute-size is used to customize the tab (U+0009width.
The following table explains the usage and version history of this attribute, as well as the usage syntax of this attribute in the JavaScript script.
Default Value: | 8 |
---|---|
Applies To: | Block Container |
Inheritance: | Yes |
Animatable: | No.Please see Animation Attributes. |
Version: | CSS3new feature |
JavaScript Syntax: | object.style.tabSize="16" |
The syntax of this attribute is as follows:
tab-size: integer | length | initial | inherit
The following examples demonstrate how to use tab-size attribute.
pre { -moz-tab-size: 4; /* Firefox */ -o-tab-size: 4; /* Opera */ tab-size: 4; }Test See‹/›
The following table describes the value of this attribute.
Value | Description |
---|---|
integer | Specify the number of spaces in the tab. It must be a positive integer. |
length | Specify the width of the tag as a length value (px, pt, cm, em, etc.), and negative length values are not allowed. |
initial | Set this attribute to its default value. |
inherit | If specified, the associated element adopts the tab of its parent element.-The value of the size attribute. |
tab-Browser Compatibility of the size attribute, the numbers in the following table represent the minimum version number of the browsers that support this attribute; all mainstream browsers support this attribute.
|
Warning:tab-The size attribute is not supported by most browsers for the length value at present. It is best to avoid using length values.
Please refer to the following tutorials:CSS Text.
Related Attributes:white-space,word-spacing.