CSS3 tab-size
Property
Topic: CSS3 Properties ReferencePrev|Next
Description
The tab-size
CSS property is used to customize the width of the tab (U+0009) character.
The following table summarizes the usages context and the version history of this property.
Default value: | 8 |
---|---|
Applies to: | Block containers |
Inherited: | Yes |
Animatable: | No. See animatable properties. |
Version: | New in CSS3 |
Syntax
The syntax of the property is given with:
The example below shows the tab-size
property in action.
Example
Try this code »pre {
-moz-tab-size: 4; /* Firefox */
-o-tab-size: 4; /* Opera */
tab-size: 4; /* Standard syntax */
}
Property Values
The following table describes the values of this property.
Value | Description |
---|---|
integer | Specifies the number of spaces in a tab. It must be positive integer. |
length | Specifies the width of a tab as a length value in px , pt , cm , em , etc. Negative length values are not allowed. |
initial |
Sets this property to its default value. |
inherit |
If specified, the associated element takes the computed value of its parent element tab-size property. |
Browser Compatibility
The tab-size
property is supported in all major modern browsers.
Basic Support—
|
Warning: The length value for the tab-size
property is currently not supported by the most of the browsers. You should better avoid using the length value.
Further Reading
See tutorial on: CSS Text.
Related properties: white-space
, word-spacing
.