Text Align

The <strong>CSS text-align</strong> property can be used to format the text in a web page, the text can be aligned to the left or right, centered or justified.
<h2>Text Align properties are:</h2>
<ul>
<li>text-align: center;</li>
</ul>
<ul>
<li>text-align: right;</li>
</ul>
<ul>
<li>text-align: left;</li>
</ul>
<ul>
<li>text-align: justify;</li>
</ul>
<h2>Text Align example:</h2>

<pre class=”brush:html”>
&lt;html&gt;
&lt;head&gt;
<style>
h1 {text-align: center;}

h2 {text-align: left;}

h3 {text-align: right;}

p {text-align: justify;}
</style>
&lt;/head&gt;
&lt;body&gt;

<h1>CSS text-align property</h1>
<h2>Align left</h2>
<h3>Align right</h3>
<p>The CSS text-align property can be used to justify web page text. This text is an example showing how to use the CSS text-align property.</p>
&lt;/body&gt;
&lt;/html&gt;
</pre>

<h2>Text Align result:</h2>
<pre>
<html>
<head>
<style>
h1 {text-align: center;}
h2 {text-align: left;}
h3 {text-align: right;}
p {text-align: justify;}
</style>
</head>
<body>

<h1>CSS text-align property</h1>
<h2>Align left</h2>
<h3>Align right</h3>
<p>The CSS text-align property can be used to justify web page text. This text is an example showing how to use the CSS text-align property.</p>
</body>
</html>
</pre>