Easy Tutorial
❮ Av Event Progress Canvas Beziercurveto ❯

HTML <h1> - <h6> align Attribute

HTML <h1-h6> Tag

Example

A centered HTML heading:


Browser Support

All major browsers support the align attribute.


Definition and Usage

In HTML 4.01, the align attribute for <h1> - <h6> is deprecated.

The align attribute specifies the horizontal alignment of the heading.


Compatibility Notes

The align attribute for <h1> - <h6> is deprecated. Use CSS instead.

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

CSS Example: Setting the alignment of a heading

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


Syntax

Attribute Values

Value Description
left Left-aligns the heading (default).
right Right-aligns the heading.
center Centers the heading.
justify The heading has reasonable margins.
❮ Av Event Progress Canvas Beziercurveto ❯