tab-size - HTML CSS CSS Property

HTML CSS examples for CSS Property:tab-size

Description

The tab-size CSS property sets the width of the tab (U+0009) character.

The following table summarizes the tab-size Property.

Item Value
Default value: 8
Applies to:Block containers
Inherited: Yes
Animatable: No.

Syntax

The syntax of the property is as follows:


tab-size:      integer | length | initial | inherit

Property Values

The following table describes the values of this property.

Value Description
integer Set the number of spaces in a tab. It must be positive integer.
length Set the width of a tab as a length value in px, pt, cm, em, etc. Negative length values are not allowed.
initial Sets this property to its default value.
inherit take the value of its parent element tab-size property.

The example below shows the tab-size property.

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html lang="en">
 <head>
  <title>Example of CSS3 tab-size Property</title>
  <style type="text/css">
  pre {<!--from ww w.j a  v a 2 s .  co m-->
        -moz-tab-size: 4; /* Firefox */
          -o-tab-size: 4; /* Opera */
             tab-size: 4; /* Standard syntax */
    }
</style>
 </head>
 <body>
  <pre>This   preformatted    text    is  using   the   tab-size   4</pre>
 </body>
</html>

Related Tutorials