tab-size property

Image Tutorials

Definition and Usage

The tab-size CSS property is used to customize the width of a tab (U+0009) character.

  • Initial8
  • Applies toblock containers
  • Inheritedyes
  • Mediavisual
  • Computed Valuethe specified integer or an absolute length
  • Animatableno
  • Canonical orderthe unique non-ambiguous order defined by the formal grammar

Syntax

Formal syntax: <integer>
tab-size: 4
tab-size: 0
tab-size: 8
tab-size: inherit

Values

<integer>
The number of spaces in a tab. Must be positive.
inherit
Inherits from the parent element.

Examples

1 pre {
2   tab-size4/* Set tab size to 4 spaces */
3 }
1 pre {
2   tab-size0/* Remove indentation */
3 }
1 pre {
2   tab-size99/* Don't use tabs! */
3 }

Compatibility

Desktop browsers

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support 21 4.0 (2.0)-moz NA 10.60-o Nightly build (537.1)

Mobile browsers

Feature iOS Safari Opera Mini Opera Mobile Android Browser
Basic support NA NA NA NA

Rate article