This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The tab-size CSS property is used to customize the width of a tab (U+0009) character.
/* <integer> values */ tab-size: 4; tab-size: 0; /* <length> values */ tab-size: 10px; tab-size: 2em; /* Global values */ tab-size: inherit; tab-size: initial; tab-size: unset;
| Initial value | 8 |
|---|---|
| Applies to | block containers |
| Inherited | yes |
| Media | visual |
| Computed value | the specified integer or an absolute length |
| Animation type | a length |
| Canonical order | the unique non-ambiguous order defined by the formal grammar |
<integer><length><integer> | <length>
pre {
tab-size: 4; /* Set tab size to 4 spaces */
}
pre {
tab-size: 0; /* Remove indentation */
}
pre {
tab-size: 2; /* Set tab size to 2 spaces */
}
| Specification | Status | Comment |
|---|---|---|
| CSS Text Module Level 3 The definition of 'tab-size' in that specification. | Working Draft | Initial definition |
| Desktop | ||||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
| Basic support | 21
|
No | 4
|
No | 15
|
6.1 |
<length>
|
42 | No | 53 | No | 29 | No |
| Mobile | |||||||
|---|---|---|---|---|---|---|---|
| Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
| Basic support | 4.4 | ? | ? | 4
|
24
|
7.1 | ? |
<length>
|
56 | ? | ? | 53 | 37 | No | ? |
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/CSS/tab-size