Nasi wolontariusze nie przetłumaczyli jeszcze tego artykułu na język Polski. Dołącz do nas i pomóż go przetłumaczyć!
Można także przeczytać artykuł w języku: English (US).

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 value8
Applies toblock containers
Inheritedyes
Mediavisual
Computed valuethe specified integer or an absolute length
Animation typea length
Canonical orderthe unique non-ambiguous order defined by the formal grammar

Syntax

Values

<integer>
The number of spaces in a tab. Must be nonnegative.
<length>
The width of a tab. Must be nonnegative.

Formal syntax

<integer> | <length>

Examples

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 */
}

Specifications

Specification Status Comment
CSS Text Module Level 3
The definition of 'tab-size' in that specification.
Working Draft Initial definition

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
Basic support
Experimental
Chrome Full support 21
Notes
Full support 21
Notes
Notes This property is not yet animatable.
Edge No support NoFirefox Full support 4
Prefixed Notes
Full support 4
Prefixed Notes
Prefixed Implemented with the vendor prefix: -moz-
Notes See bug 737785 for the status of unprefixing this property.
Notes Before Firefox 53, this property was not animatable.
IE No support NoOpera Full support 15
Full support 15
Full support 10.5
Prefixed
Prefixed Implemented with the vendor prefix: -o-
Safari Full support 6.1WebView Android Full support 4.4Chrome Android ? Edge Mobile ? Firefox Android Full support 4
Prefixed Notes
Full support 4
Prefixed Notes
Prefixed Implemented with the vendor prefix: -moz-
Notes See bug 737785 for the status of unprefixing this property.
Notes Before Firefox 53, this property was not animatable.
Opera Android Full support 24
Full support 24
Full support 11.5
Prefixed
Prefixed Implemented with the vendor prefix: -o-
Safari iOS Full support 7.1Samsung Internet Android ?
<length>
Experimental
Chrome Full support 42Edge No support NoFirefox Full support 53IE No support NoOpera Full support 29Safari No support NoWebView Android Full support 56Chrome Android ? Edge Mobile ? Firefox Android Full support 53Opera Android Full support 37Safari iOS No support NoSamsung Internet Android ?

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown
Experimental. Expect behavior to change in the future.
Experimental. Expect behavior to change in the future.
See implementation notes.
See implementation notes.
Requires a vendor prefix or different name for use.
Requires a vendor prefix or different name for use.

See also