English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
This article introduces HTML h1 – h6 The align attribute specifies the horizontal alignment of the heading, with online examples demonstrating how to use HTML h1 – h6 Detailed information about the align attribute, browser compatibility, syntax definition, and its attribute values.
Centered, left, and right aligned HTML headings:
<h1 align="center">This is heading 1</h1> <h2 align="left">This is heading 2</h2> <h3 align="right">This is heading 3</h3> <h4 align="justify">This is heading 4</h4> <h5 align="justify">This is heading 5</h5> <h6 align="justify">This is heading 6</h6>Test to see ‹/›
IEFirefoxOperaChromeSafari
All major browsers support the align attribute.
HTML5 Does not support <h1> - <h6> align attribute. Use CSS instead.
In HTML 4.01 In1> - <h6> The align attribute is deprecated.
The align attribute specifies the horizontal alignment of the title.
<h1> - <h6> The align attribute is deprecated. Use CSS instead.
CSS Syntax: <h1 style="text-align:right">
CSS Example: Set the alignment of the title
In our CSS tutorial, you can find more abouttext-align Attributedetails.
<h1 align="left|right|center|justify">
Value | Description |
---|---|
left | Left align the title (default value). |
right | Right align the title. |
center | Center align the title. |
justify | Titles have reasonable margins. |