tab-size property CSS Reference

Definition and Usage

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

  • Initial 8
  • Applies to block containers
  • Inherited yes
  • Media visual
  • Computed Value the specified integer or an absolute length
  • Animatable no
  • Canonical order the unique non-ambiguous order defined by the formal grammar


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


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


pre {
  tab-size: 4; /* Set tab size to 4 spaces */
pre {
  tab-size: 0; /* Remove indentation */
pre {
  tab-size: 99; /* Don't use tabs! */


Desktop browsers

FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support214.0 (2.0)-mozNA10.60-o Nightly build (537.1)

Mobile browsers

FeatureiOS SafariOpera MiniOpera MobileAndroid Browser
Basic supportNANANANA

Relative articles