Revision 12405 of tab-size

  • Revision slug: CSS/tab-size
  • Revision title: tab-size
  • Revision id: 12405
  • Created:
  • Creator: leaverou
  • Is current revision? No
  • Comment 36 words added

Revision Content

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

Browser compatibility

Browser Lowest Version Support of
Internet Explorer --- ---
Firefox 4.0 (Gecko 2.0) -moz-tab-size
Opera 10.60 -o-tab-size
Safari (WebKit) --- ---

See also

Revision Source

<h2>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> <li>{{ Xref_cssinitial() }}: 8</li> <li>Applies to: all elements</li> <li>{{ Xref_cssinherited() }}: yes</li> <li>Media: {{ Xref_cssvisual() }}</li> <li>{{ Xref_csscomputed() }}: as specified</li>
</ul>
<h2>Syntax</h2>
<pre>tab-size: &lt;integer&gt; | inherit
</pre>
<h3>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>
<h3>Examples</h3>
<pre>pre {
  tab-size: 4; /* Set tab size to 4 spaces */
}
</pre>
<pre>pre {
  tab-size: 0; /* Remove indentation */
}
</pre>
<pre>pre {
  tab-size: 99; /* Don't use tabs! */
}
</pre>
<h2>Specifications</h2>
<ul> <li><a class="external" href="http://dev.w3.org/csswg/css3-text/#tab-size"><cite>CSS Text Level 3 ― The "tab-size" property</cite></a> W3C Editor's Draft</li>
</ul>
<h2>Browser compatibility</h2>
<table class="standard-table"> <tbody> <tr> <th>Browser</th> <th>Lowest Version</th> <th>Support of</th> </tr> <tr> <td>Internet Explorer</td> <td>---</td> <td>---</td> </tr> <tr> <td>Firefox</td> <td>4.0 (Gecko 2.0)</td> <td><code>-moz-tab-size</code></td> </tr> <tr> <td>Opera</td> <td>10.60</td> <td><code>-o-tab-size</code></td> </tr> <tr> <td>Safari (WebKit)</td> <td>---</td> <td>---</td> </tr> </tbody>
</table>
<h2>See also</h2>
<ul> <li><a href="/en/CSS/CSS_Reference" title="CSS Reference">CSS Reference</a></li> <li><a class=" link-https" href="https://bugs.webkit.org/show_bug.cgi?id=52994">WebKit bug on tab-size</a></li> <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