Jun 22, 2016

HTML Text Alignment

HTML Text Alignment specifies the horizontal alignment of text in an element.
Example :

<h1 style="text-align:left;">left Heading</h1>
<h2 style="text-align:center;">Centered Heading</h2>
<h3 style="text-align:right;">right Heading</h1>
<p>Dropdownlist selected index changed even is not firing.</p>


Result will show:

left Heading
Centered Heading
right Heading
Dropdownlist selected index changed even is not firing.


 Align text to both the left and right margins, adding extra space between words as necessary. This creates a clean look along the left and right side of the page.

For equal width we use the ALIGN- JUSTIFY
Align-justify always use in newspapers and magazines.
Advanced text-align example: 

<h1 style="text-align:left;">left Heading</h1>
<h2 style="text-align:center;">Centered Heading</h2>
<h3 style="text-align:right;">right Heading</h3>
<p style="text-align:justify;">justify Heading</p>
<p>Dropdownlist selected index changed even is not firing.</p>


Result will shown below:

left Heading
Centered Heading
right Heading
justify Heading
Dropdownlist selected index changed even is not firing.