The six different HTML headings are:
Heading 1
Heading 2
Heading 3
Heading 4
Heading 5
Heading 6
These tags are used to define HTML headings. The heading level is indicated by the number preceding the tag name (e.g.,
, , etc.).
Definition and Usage
The purpose of these tags is to provide a way to structure content on a web page, making it more accessible and easier to read. Only one
per page should be used, as this represents the main heading or subject for the entire page.
Global Attributes and Event Attributes
The HTML headings also support Global Attributes and Event Attributes. For example:
This code sets the background color of headings with
and text color of headings with .
Default CSS Settings
Most browsers will display the following default values for each heading level:
display: block; font-size: 2em; margin-top: 0.67em; margin-bottom: 0.67em; margin-left: 0; margin-right: 0; font-weight: bold;
display: block; font-size: 1.5em; margin-top: 0.83em; margin-bottom: 0.83em; margin-left: 0; margin-right: 0; font-weight: bold;
display: block; font-size: 1.17em; margin-top: 1em; margin-bottom: 1em; margin-left: 0; margin-right: 0; font-weight: bold;
display: block; font-size: 1em; margin-top: 1.33em; margin-bottom: 1.33em; margin-left: 0; margin-right: 0; font-weight: bold;
display: block; font-size: 0.83em; margin-top: 1.67em; margin-bottom: 1.67em; margin-left: 0; margin-right: 0; font-weight: bold;
display: block; font-size: 0.67em; margin-top: 2.33em; margin-bottom: 2.33em; margin-left: 0; margin-right: 0; font-weight: bold;
This code sets the default CSS values for each heading level.
Sources:- [
HTML h1 to h6 tag - W3Schools] (
https://www.w3schools.com/tags/tag_hn.asp)
- [
What is an H1 Tag? Examples & SEO Best Practices - Moz] (
https://moz.com/learn/seo/h1-tags)
- [
–: The HTML Section Heading elements - MDN
] (
https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/Heading_Elements)
- [
What is an H1 Tag? SEO Best Practices - Ahrefs] (
https://ahrefs.com/blog/h1-tag/)
- [
USCIS] (
https://www.uscis.gov/newsroom/alerts/h-1b-faq)
- [
H1 Tag Best Practices: Definition, Strategy, and Examples] (
https://backlinko.com/h1-tag)
- [
What Is an H1 Tag? Why It Matters & Best Practices for SEO] (
https://www.semrush.com/blog/h1-tag/?msockid=2ed037d2e6f0624d0e122156e75663fd)
- [
What is an H1 Tag: A Beginner's Guide With Best Practices] (
https://bloggerspassion.com/h1-tag/)
- [
What Is An H1 Heading? And Why They Still Matter In 2025] (
https://www.laurajawadmarketing.com/blog/what-is-an-h1-heading/)
- [
Header Tags: A Simple (But Complete) Guide To H1, H2 and H3 …] (
https://seosherpa.com/header-tags/)