text-indent

Browser Internet Explorer Netscape Opera Safari Firefox
Version 5.5 6.0 7.0 8.0 8.0 9.0 7.0 8.0 9.2 9.5 1.3 2.0 3.1 1.5 2.0 3.0
Supported Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes

Short information
CSS CSS1
Default value 0
Inherited Yes
Applied To block elements
HTML analog No
Reference to specification http://www.w3.org/TR/CSS21/text.html#propdef-text-indent

Description
It determines the first line space size of the text block (for example, for the paragraph

). Influences for all other lines do not appear. Negative value for ledge creation of the first line is supposed, but it is necessary to check up that the text do not fall outside the limits of a browser window.

Syntax

text-indent: value | percent

Arguments
Any units of length accepted in CSS are applied as values, for example pixels (px), inches (in), points (pt), etc. When you specify the value in percentage, the space of the first line is calculated depending on the block width. It is admissible to apply negative values, but thus occurrence of errors may be in different browsers.

Example

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
 <head>
  <meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
  <title>text-indent</title>
  <style type="text/css">
   P { 
    text-indent: 1.5em; /* Indent of first line */
    text-align: justify;  /* Width alignment */
   }
  </style> 
 </head> 
 <body>
 
   <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diem 
    nonummy nibh euismod tincidunt ut lacreet dolore magna aliguam erat volutpat. 
    Ut wisis enim ad minim veniam, quis nostrud exerci tution ullamcorper suscipit 
    lobortis nisl ut aliquip ex ea commodo consequat.</p>
 
 </body>
</html>

The result of this example is shown on the figure 1


Object model

[window.]document.getElementById("elementID").style.textIndent
Private Cloud
IT disaster recovery
Differential Backup
Cloud Technology