Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

CSS tab-size property


May 06, 2021 CSS Reference Manual


Table of contents


CSS tab-size property

CSS tab-size property CSS reference manual


Set a tab-size for an element:

pre {tab-size: 16; }
Pre {-Moz-Tab-Size: 16;} / * For Firefox code * /
Pre {-o-tab-size: 16;} / * For Opera's code * /

Try it out . . .

Browser support

CSS tab-size property CSS tab-size property CSS tab-size property CSS tab-size property CSS tab-size property

Currently, only Chrome supports tab-size properties.

Firefox supports another property that replaces this property, the -moz-tab-size property.

Opera supports another property that replaces this property, the -o-tab-size property.

Currently, no browser supports this value as a length unit.


Definitions and usages

The tab-size property specifies the length of the space for tab characters.

In HTML, tab characters typically appear as a single space character, except for elements such as the results of the tab-size property, which are valid only for those elements.

Default: 8
Inherited: Is
Animated: Whether. See Animation .
Version: CSS3
JavaScript syntax: object .style.tabSize="16" Give it a try


CSS syntax

tab-size: number | length |initial|inherit;

The property value

value describe test
number The default is 8.Specifies the number of space characters to display each tab (Tab) character. test "
length Specify the length of the tab (Tab) character.Almost all mainstream browsers do not support this attribute value.
initial Set this property for its default value.See initial test "
inherit Inheriting this property from the parent element.See inherit

CSS tab-size property CSS reference manual