Table of contents
- 1. Summary
- 2. Syntax
- 3. Specifications
- 4. Browser compatibility
- 5. See also
Summary
The tab-size CSS property is used to customize the width of a tab (U+0009) character.
- Initial value : 8
- Applies to: all elements
- Inherited : yes
- Media:
visual - Computed value : as specified
Syntax
tab-size: <integer> | inherit
Values
<integer>- The number of spaces in a tab. Must be positive.
- inherit
- Inherits from the parent element.
Examples
pre {
tab-size: 4; /* Set tab size to 4 spaces */
}
pre {
tab-size: 0; /* Remove indentation */
}
pre {
tab-size: 99; /* Don't use tabs! */
}
Specifications
- CSS Text Level 3 ― The "tab-size" property W3C Editor's Draft
Browser compatibility
| Browser | Lowest Version | Support of |
|---|---|---|
| Internet Explorer | --- | --- |
| Firefox | 4.0 (Gecko 2.0) | -moz-tab-size |
| Opera | 10.60 | -o-tab-size |
| Safari (WebKit) | --- | --- |
See also
- CSS Reference
- WebKit bug on tab-size
- Controlling size of a tab character (U+0009), an email by Anne van Kesteren (Opera) to the CSSWG.


Mozilla Developer Network