X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY ANGULAR BOOTSTRAP XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

HTML <h1> to <h6> align Attribute

HTML h1 to h6 Tag Reference HTML <h1 to h6> tag

Example

A center-aligned HTML heading:

<h1 align="center">This is heading 1</h1>

Try it Yourself »

Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The align attribute is supported in all major browsers.


Definition and Usage

The align attribute specifies the horizontal alignment of a heading.


Compatibility Notes

The align attribute of <h1> to <h6> is not supported in HTML5. Use CSS instead.

CSS syntax: <h1 style="text-align:right">

CSS Example: Set the alignment of headings

In our CSS tutorial you can find more details about the text-align property.


Syntax

<h1 align="left|right|center|justify">

Attribute Values

Value Description
left Left-aligns the heading
right Right-aligns the heading
center Center-aligns the heading
justify The heading is justified to both margins


HTML h1 to h6 Tag Reference HTML <h1 to h6> tag

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook