mozilla

Revision 499341 of tab-size

  • Revision slug: Web/CSS/tab-size
  • Revision title: tab-size
  • Revision id: 499341
  • Created:
  • Creator: SJW
  • Is current revision? No
  • Comment

Revision Content

{{ CSSRef() }}

{{ SeeCompatTable() }}

Summary

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

{{cssbox("tab-size")}}

Syntax

Formal syntax: {{csssyntax("tab-size")}}
tab-size: 4
tab-size: 0
tab-size: 8

tab-size: inherit

Values

{{ Xref_cssinteger() }}
The number of spaces in a tab. Must be positive.
{{ Xref_csslength() }}
The width of a tab. Must be positive.
inherit
Inherits from the parent element.

Examples

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

Specifications

Specification Status Comment
{{ SpecName('CSS3 Text', '#tab-size', 'tab-size') }} {{ Spec2('CSS3 Text') }}  

Browser compatibility

{{ CompatibilityTable() }}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support 21 {{ CompatGeckoDesktop("2.0") }}{{ property_prefix("-moz") }} {{ CompatUnknown() }} 10.60{{ property_prefix("-o") }} {{ CompatNightly() }} (537.1)
{{ Xref_csslength() }} {{ CompatNo() }} {{ CompatNo() }} {{ CompatNo() }} {{ CompatUnknown() }} {{ CompatNo() }}
Feature iOS Safari Opera Mini Opera Mobile Android Browser
Basic support {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }}

See also

Revision Source

<p>{{ CSSRef() }}</p>
<p>{{ SeeCompatTable() }}</p>
<h2 id="Summary">Summary</h2>
<p>The <code>tab-size</code> CSS property is used to customize the width of a tab (<code>U+0009</code>) character.</p>
<p>{{cssbox("tab-size")}}</p>
<h2 id="Syntax">Syntax</h2>
<pre class="twopartsyntaxbox">
<a href="/en-US/docs/CSS/Value_definition_syntax" title="CSS/Value_definition_syntax">Formal syntax</a>: {{csssyntax("tab-size")}}
</pre>
<pre>
tab-size: 4
tab-size: 0
tab-size: 8

tab-size: inherit
</pre>
<h3 id="Values">Values</h3>
<dl>
 <dt>
  {{ Xref_cssinteger() }}</dt>
 <dd>
  The number of spaces in a tab. Must be positive.</dd>
 <dt>
  {{ Xref_csslength() }}</dt>
 <dd>
  The width of a tab. Must be positive.</dd>
 <dt>
  <code>inherit</code></dt>
 <dd>
  Inherits from the parent element.</dd>
</dl>
<h2 id="Examples">Examples</h2>
<pre class="brush: css">
pre {
&nbsp;&nbsp;tab-size: 4; /* Set tab size to 4 spaces */
}
</pre>
<pre class="brush: css">
pre {
&nbsp;&nbsp;tab-size: 0; /* Remove indentation */
}
</pre>
<pre class="brush: css">
pre {
&nbsp;&nbsp;tab-size: 99; /* Don't use tabs! */
}
</pre>
<h2 id="Specifications">Specifications</h2>
<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{ SpecName('CSS3 Text', '#tab-size', 'tab-size') }}</td>
   <td>{{ Spec2('CSS3 Text') }}</td>
   <td>&nbsp;</td>
  </tr>
 </tbody>
</table>
<h2 id="Browser_compatibility" style="clear: both">Browser compatibility</h2>
<p>{{ CompatibilityTable() }}</p>
<div id="compat-desktop">
 <table class="compat-table">
  <tbody>
   <tr>
    <th>Feature</th>
    <th>Chrome</th>
    <th>Firefox (Gecko)</th>
    <th>Internet Explorer</th>
    <th>Opera</th>
    <th>Safari</th>
   </tr>
   <tr>
    <td>Basic support</td>
    <td>21</td>
    <td>{{ CompatGeckoDesktop("2.0") }}{{ property_prefix("-moz") }}</td>
    <td>{{ CompatUnknown() }}</td>
    <td>10.60{{ property_prefix("-o") }}</td>
    <td>{{ CompatNightly() }} (537.1)</td>
   </tr>
   <tr>
    <td>{{ Xref_csslength() }}</td>
    <td>{{ CompatNo() }}</td>
    <td>{{ CompatNo() }}</td>
    <td>{{ CompatNo() }}</td>
    <td>{{ CompatUnknown() }}</td>
    <td>{{ CompatNo() }}</td>
   </tr>
  </tbody>
 </table>
</div>
<div id="compat-mobile">
 <table class="compat-table">
  <tbody>
   <tr>
    <th>Feature</th>
    <th>iOS Safari</th>
    <th>Opera Mini</th>
    <th>Opera Mobile</th>
    <th>Android Browser</th>
   </tr>
   <tr>
    <td>Basic support</td>
    <td>{{ CompatUnknown() }}</td>
    <td>{{ CompatUnknown() }}</td>
    <td>{{ CompatUnknown() }}</td>
    <td>{{ CompatUnknown() }}</td>
   </tr>
  </tbody>
 </table>
</div>
<h2 id="See_also">See also</h2>
<ul>
 <li><a class="external" href="http://lists.w3.org/Archives/Public/www-style/2008Dec/0009.html" title="http://lists.w3.org/Archives/Public/www-style/2008Dec/0009.html"><cite>Controlling size of a tab character (U+0009)</cite></a>, an email by Anne van Kesteren (Opera) to the CSSWG.</li>
</ul>
Revert to this revision