Definition and Usage The align attribute specifies horizontal alignment of the header element. Compatibility Notes The align attribute of t...
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">
Syntax
Syntax Example
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.
Example
Source | Output |
<h3 align="right">Hello world</h3> | Hello world |