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 event is not firing.</p>


Result will show:

left Heading
Centered Heading
right Heading
Dropdownlist selected index changed event 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 event is not firing.</p>


The result will show below:

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


No comments:

Post a Comment

Please do not enter any spam link in the comment box.

Related Posts

What is the Use of isNaN Function in JavaScript? A Comprehensive Explanation for Effective Input Validation

In the world of JavaScript, input validation is a critical aspect of ensuring that user-provided data is processed correctly. One indispensa...