tab-size

  • Revision slug: CSS/tab-size
  • Revision title: tab-size
  • Revision id: 357361
  • Created:
  • Creator: teoli
  • Is current revision? No
  • Comment Revert to revision of 2012-09-07 02:23:07 by jhasse

Revision Content

{{ CSSRef() }}

{{ SeeCompatTable() }}

Summary

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

  • {{ Xref_cssinitial() }} 8
  • Applies to all elements
  • {{ Xref_cssinherited() }} yes
  • Media {{ Xref_cssvisual() }}
  • {{ Xref_csscomputed() }} as specified

Syntax

tab-size: <integer> | inherit

Values

{{ Xref_cssinteger() }}
The number of spaces in 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)
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>
<ul class="cssprop">
  <li><dfn>{{ Xref_cssinitial() }}</dfn> 8</li>
  <li><dfn>Applies to</dfn> all elements</li>
  <li><dfn>{{ Xref_cssinherited() }}</dfn> yes</li>
  <li><dfn>Media</dfn> {{ Xref_cssvisual() }}</li>
  <li><dfn>{{ Xref_csscomputed() }}</dfn> as specified</li>
</ul>
<h2 id="Syntax">Syntax</h2>
<pre>
tab-size: &lt;integer&gt; | 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>
    inherit</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>
    </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