The cover of The Complete Idiot's Guide to Create a Web Page The Complete Idiot's Style Sheets Reference

| Index | Current Category: Text |
| Previous Style: text-decoration | Next Style: text-shadow |


text-indent

Indents the first line of text in a block (such as a paragraph).

Support:

W3C StandardInternet ExplorerNetscape Navigator
CSS1 and later 3.0 and later 4.0 and later
Possible Values:
[length]
The indent amount.

Support:

W3C StandardInternet ExplorerNetscape Navigator
CSS1 and later 3.0 and later 4.0 and later

Notes:
  • You can use negative numbers to get what's known in the trade as an outdent.

[percentage]
The size of the indent as a percentage of the current block size.

Support:

W3C StandardInternet ExplorerNetscape Navigator
CSS1 and later 3.0 and later 4.0 and later

Example:
<STYLE TYPE="text/css">
<!--
P {text-indent: 0.5in}
-->
</STYLE>

<H1>Textstyles: More Ways to Format Text</H1>
<P>Besides fiddling with fonts, style sheets offer a few other 
ways to format your page text. This section looks at four of them: 
indentation, alignment, underlining, and casing.
<H2>Controlling Indents</H2>
<P>Many professionally-typeset pages indent the beginning of each 
paragraph. The only way to do that in regular HTML is to string 
together a series of non-breaking spaces (<TT>&nbsp;</TT>) at 
the start of each paragraph. With style sheets, however, it's no 
sweat because you just use the <TT>text-indent</TT> style. For 
example, this page includes a style sheet that tells the 
browser to indent the first line of every paragraph by half an inch.
How It Looks:

Textstyles: More Ways to Format Text

Besides fiddling with fonts, style sheets offer a few other ways to format your page text. This section looks at four of them: indentation, alignment, underlining, and casing.

Controlling Indents

Many professionally-typeset pages indent the beginning of each paragraph. The only way to do that in regular HTML is to string together a series of non-breaking spaces (&nbsp;) at the start of each paragraph. With style sheets, however, it's no sweat because you just use the text-indent style. For example, this page includes a style sheet that tells the browser to indent the first line of every paragraph by half an inch.


| Index | Current Category: Text |
| Previous Style: text-decoration | Next Style: text-shadow |