CoderTools Web site

CSS Indent Text - text-indent

Description


Use the text-indent property to horizontally indent text within block level html elements.

Default is 0px;

    text-indent: length;         /* e.g.  25px   */
    text-indent: percentage;     /* e.g.  25%    */
    text-indent: inherit;
    
See also: text-decoration, text-align, text-transform, white-space.
HTML & CSS Editor with FTP / FTPS

Examples for text-indent

Example 1:

An example showing a 30 pixel indent:

A 30 pixel indent
    <style>
        #test { text-indent: 30px; border: 1px solid gray; }
    </style>

    <div id="test">A 30 pixel indent</div>

Example 2:

An example showing a 25% indent. Note the percentage refers to the parent block element width which in this case is 25% of the width of the div:

A 25% indent
    <style>
        #test2 { text-indent: 25%; border: 1px solid gray; }
    </style>

    <div id="test">A 25% indent</div>

Values for text-indent


Name Values Description
text-indent length
percentage
inherit
Use the text-indent property to horizontally indent text within block level html elements.


TotalEdit Now Completely Free

CoderTools TotalEdit - The Free Text Editor

A powerful editor and notepad replacement TotalEdit makes it easier to complete your file editing and software development tasks. TotalEdit is FREE for commercial and non-commercial purposes (its freeware).

12/16/2017 11:29:32 AM
Terms Of Use | Privacy Statement | Copyright 2006-2015 © Independence Software LLP