The text-indent property is used to change the indentation of the text in a Web page. Let's create a Web page, named textindentation.html
<!doctype html>
<head>
<title> Text Indentation property </title>
</head>
<body>
<h1 style="text-indent:2in;">This header is indented by 2 inches.</h1>
<h2 style="text-indent:3px;">This header is indented by 3 pixel.</h2>
<h1 style="text-indent:4em;">This header is indented by 4em.</h1>
<p style="text-indent:25%;">The first line of text in this paragraph is indented by 25% of the browser window's width.</p>
<p style="text-indent:-2in;">The first words in this text do not appear onscreen, as text-indent is set to a value of -1 inch.</p>
</body>
</html>
The Output of the textindentation.html file is shown:
<!doctype html>
<head>
<title> Text Indentation property </title>
</head>
<body>
<h1 style="text-indent:2in;">This header is indented by 2 inches.</h1>
<h2 style="text-indent:3px;">This header is indented by 3 pixel.</h2>
<h1 style="text-indent:4em;">This header is indented by 4em.</h1>
<p style="text-indent:25%;">The first line of text in this paragraph is indented by 25% of the browser window's width.</p>
<p style="text-indent:-2in;">The first words in this text do not appear onscreen, as text-indent is set to a value of -1 inch.</p>
</body>
</html>
The Output of the textindentation.html file is shown:
No comments:
Post a Comment