HTML CSS SQL Meta tag Generator ScrollBar design Generator Encode Decode images

CSS Basics

Introduction Syntax Selectors Attribute Selectors Specificity Combinators !important Comments Colors

CSS Need to Know

Box Model Pseudo-class Pseudo-element Inline-block Math Functions Max and Min Opacity Outline Overflow Z-index Float

Most used

Align Backgrounds Borders Text Units Padding Margins Position Tables Display Fonts Lists Height and Width

CSS Reference

CSS Properties reference CSS Pseudo-Classes reference CSS Pseudo-Elements reference CSS Selector reference
CSS tab-size Tutorial

CSS tab-size

The CSS tab-size property is used to specify the width of a tab character. Tabs are commonly used in code snippets and pre-formatted text.

By default, the tab character width is set to 8 spaces in most browsers. You can use the tab-size property to change this default behavior.

Syntax:


        selector {
            tab-size: length;
        }
    

In the syntax above, the selector is the HTML element or class to which you want to apply the tab-size property. The length specifies the width of the tab character in CSS units like pixels or em.

Example:

Result:

            tab-size: 4;
        

This example sets the tab character width to 4 spaces. You can see the difference in tab width below:


            <html>
            <head>
                <title>Example</title>
            </head>
            <body>
                <h1>Hello, World!</h1>
            </body>
            </html>
        

The above code snippet shows a simple HTML document with a tab character width of 4 spaces applied.

.periodic {
   display: table;
}