|
|
Style Object textIndent Property
Style Object
Definition and Usage
The textIndent property indents the first line of text in an element.
Syntax
|
Object.style.textIndent=length|%
|
Possible Values
| Value |
Description |
| length |
Defines a fixed indentation |
| % |
Defines an indentation in % of the width of the parent
element |
Example
Example
The following example indents a text:
<html>
<head>
<script type="text/javascript">
function setTextIndent()
{
document.getElementById("div1").style.textIndent="50px";
}
</script>
</head>
<body>
<div id="div1">
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.
</div>
<br />
<input type="button" onclick="setTextIndent()"
value="Indent first line of text" />
</body>
</html>
|
Try it yourself »
|
Style Object
|
|
|