tab-size

Determines the width of tab characters ( ) in your text. This is extremely useful for styling code blocks or pre-formatted text where you want consistent indentation.

It is documented as part of the CSS Text specification.

/* Usage Example */
pre {
  /* Sets the width of a tab character to be equal to 2 spaces */
  tab-size: 2;
}

/* Global values */
tab-size: inherit;
tab-size: initial;
tab-size: revert;
tab-size: revert-layer;
tab-size: unset;
Widely available Since 2021 96% global usage

This feature is well established and works across many devices and browser versions. It has been available across browsers since 2021.

21+
91+
7+
79+
Kinsta

Your first month is free

Managed WordPress hosting for faster sites.

Learn more

New CSS drops.

Join 600+ readers who've survived clearfix hacks.

ESC