HTML h1 to h6 align Attribute
HTML <h1 to h6> tag
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">
In our CSS tutorial you can find more details about the
text-align property.
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">W3Schools</h3>
|
W3Schools |
Try-It-Yourself Demos
h1 to h6 align
attribute example
Set the header text alignment with the h1-h6 align attribute.
In CSS:
header alignment example
Set the header text alignment with CSS.
HTML <h1 to h6> tag
 |

|
|
See why there are 20,000+ Ektron integrations worldwide.
Request an INSTANT DEMO or download a FREE TRIAL today. |
|
|
|