Skip to main content
Practice

h Tags

HTML h tags are used to define headings.

Heading tags indicate the structure of the document and denote the importance of the titles.

The <h1> tag represents the main heading and is used for the title of the webpage or the top-level sections.

The <h1> tag should be used only once per webpage, and it is recommended not to use it multiple times on the same page.

h1 Tag
<h1>Webpage Title</h1>

The <h2> tag is slightly smaller than the <h1> tag and is used for sub-headings within sections of the webpage.

h2 Tag
<h2>Section Title</h2>

There are also <h3>, <h4>, <h5>, and <h6> tags, with the numeral indicating a decrease in the heading size as the number increases.

Want to learn more?

Join CodeFriends Plus membership or enroll in a course to start your journey.