CSS tab-size Property
Definition and Usage
The tab-size property specifies the width of a tab character.
In HTML, the tab character is usually displayed as a single space-character, except for some elements, like <textarea> and <pre>, and the result of the tab-size property will only be visible for those elements.
| Default value: | 8 |
|---|---|
| Inherited: | yes |
| Animatable: | no. Read about animatable |
| Version: | CSS3 |
| JavaScript syntax: | object.style.tabSize="16" Try it |
Browser Support
The numbers in the table specify the first browser version that fully supports the property.
| Property | |||||
|---|---|---|---|---|---|
| tab-size | 21 | 79 | 91 | 7 | 15 |
CSS Syntax
tab-size: number|length|initial|inherit;
Property Values
| Value | Description | Play it |
|---|---|---|
| number | The number of space-characters to be displayed for each tab-character. Default value is 8 | Demo ❯ |
| length | The length of a tab-character | |
| initial | Sets this property to its default value. Read about initial | |
| inherit | Inherits this property from its parent element. Read about inherit |