Skip to content
Related Articles

Related Articles

HTML | <h1> to <h6> align Attribute

View Discussion
Improve Article
Save Article
  • Last Updated : 25 Feb, 2022

The HTML <h1> to <h6> align Attribute is used to specify the alignment of the <h> element or the content present inside the Heading Element.

Note: This attribute is not supported by HTML5.


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

Attribute Values:

  • left: It sets the content to the left-align. By default, it is aligned to left.
  • right: It sets the content to the right-align.
  • center: I sets the div element to the center.
  • justify: It sets the content to the justify position.


<!DOCTYPE html>
    <h1 align="center">center</h1>
    <h2 align="left">left 2</h2>
    <h3 align="right">right 3</h3>
    <h4 align="justify">justify</h4>

Output :

Supported Browsers: The browsers supported by HTML h1 align Attribute are listed below:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Apple Safari
  • Opera
My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!