Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML h1-h6 align Attribute

HTML

-

The align attribute

HTML h1-h6 Tag Reference HTML tag

Example

A centered HTML heading:

This is heading 1

This is heading 2

This is heading 3

This is heading 4

Try it »


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the align attribute.


Definition and Usage

HTML5 does not support

-

the align attribute. Please use CSS instead.

In HTML 4.01,

-

The align attribute is deprecated.

The align attribute specifies the horizontal alignment of the heading.


Compatibility notes

-

The align attribute is deprecated. Please use CSS instead.

CSS syntax:

CSS example: setting the alignment of headings

In our CSS tutorial, you can find more details about The text-align propertydetails.


Syntax

Attribute values

Value Description
left Left-align the heading (default).
right Right-align the heading.
center Center-align the heading.
justify The heading has justified margins.

HTML h1-h6 Tag Reference HTML tag