HTML h1, h2, h3, h4, h5 and h6 tags align property

Definition and Usage

The align attribute specifies horizontal alignment of the header element.

Compatibility Notes

The align attribute of the  h1 to h6 elements was deprecated in HTML 4.01 and is not supported in XHTML 1.0 Strict DTD.
Use CSS instead.
CSS syntax: <h1 style="text-align:right">


<h1 align="alignment">

Syntax Example

<h1 align="right">

Attribute Values

Value Description
left Left-align text.
right Right-align text.
center Center-align text.
justify  Justify text within left and right margins.

Browser Support

The attribute is deprecated, but still supported in all major browsers.


Source Output
<h3 align="right">Hello world</h3>

Hello world

Share this article :
Copyright © 2012. Best Online Tutorials | Source codes | Programming Languages - All Rights Reserved