tab-size property
The tab-size property sets the size
of the indent created by the Tab key.
Works only if the
white-space
property is set to pre or pre-wrap,
as well as for the
pre tag.
The property value takes a positive integer,
which specifies the number of white spaces that
would be made by the Tab key. Default
value: 8 spaces.
Syntax
selector {
tab-size: positive integer;
}
Example
We set the Tab indentation
equal to 0 white spaces:
<div id="elem">
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
</div>
#elem {
tab-size: 0;
white-space: pre;
border: 1px solid black;
}
:
Example
We set the Tab indent
equal to 1 space:
<div id="elem">
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
</div>
#elem {
tab-size: 1;
white-space: pre;
border: 1px solid black;
}
:
Example
We set the Tab indent
equal to 2 spaces:
<div id="elem">
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
</div>
#elem {
tab-size: 2;
white-space: pre;
border: 1px solid black;
}
: