🚨 $100K in Sight: Follow Bitcoin’s Final Push Live! TRACK NOW

Code has been added to clipboard!

HTML h element

Reading time 1 min
Published Jun 29, 2017
Updated Oct 2, 2019

HTML h Element: Main Tips

  • HTML defines headings in a web document by using the six HTML heading elements from <h1> to <h6>.
  • The text content of an <h1> element has a bigger font size than other heading tags. The size of the font decreases from <h1> to <h6> tags.
DataCamp
Pros
  • Easy to use with a learn-by-doing approach
  • Offers quality content
  • Gamified in-browser coding experience
  • The price matches the quality
  • Suitable for learners ranging from beginner to advanced
Main Features
  • Free certificates of completion
  • Focused on data science skills
  • Flexible learning timetable
Udacity
Pros
  • Simplistic design (no unnecessary information)
  • High-quality courses (even the free ones)
  • Variety of features
Main Features
  • Nanodegree programs
  • Suitable for enterprises
  • Paid Certificates of completion
edX
Pros
  • A wide range of learning programs
  • University-level courses
  • Easy to navigate
  • Verified certificates
  • Free learning track available
Main Features
  • University-level courses
  • Suitable for enterprises
  • Verified certificates of completion

Heading Elements

These HTML elements set headings in a document. The h1 element is the HTML tag for largest heading. You can use h1 for the main titles, h2 element for section titles, and h3 for smaller sub-sections.

Tip: the use of headings is highly recommended since search engines use them to index websites.

Example
<h1>Heading text - Level 1. Most Important Heading</h1>
<h2>Heading text - Level 2</h2>
<h3>Heading text - Level 3</h3>
<h4>Heading text - Level 4</h4>
<h5>Heading text - Level 5</h5>
<h6>Heading text - Level 6. Least Important Heading</h6>

Note: web browsers normally add top and bottom margins to the content for every heading tag in HTML. Also, they set their text content to a bolder font.

align

It sets the horizontal alignment of the heading elements.

Tip: HTML5 does not support align. You should use CSS text-align property instead.

Example
<h1 align="center">Random text - Level 1</h1>
<h2 align="right">Random text - Level 2</h2>
<h3 align="right">Random text - Level 3</h3>
<h4 align="justify">Random text - Level 4</h4>
<h5 align="left">Random text - Level 5</h5>
<h6 align="center">Random text - Level 6</h6>

Browser support

Browser image
Chrome
All
Browser image
Edge
All
Browser image
Firefox
1+
Browser image
IE
All
Browser image
Opera
All
Browser image
Safari
All

Mobile browser support

Browser image
Chrome
All
Browser image
Firefox
4+
Browser image
Opera
All
Browser image
Safari
All