HTML Headings
HTML headings are titles or subtitles that you want to display on a webpage.
HTML headings are titles or subtitles that you want to display on a webpage.
<h1> Heading 1 </h1>
<h2> Heading 2 </h2>
<h3> Heading 3 </h3>
<h4> Heading 4 </h4>
<h5> Heading 5 </h5>
<h6> Heading 6 </h6>
The to HTML elements represent six levels of section headings. h1 is the highest section level and h6 is the lowest.
This is the highest level heading and represents the main title of the page.
There should typically be only one <h1>
per page.
<h1>Main Page Title</h1>
These headings are used to define subsections within the <h1>
section.
They indicate a lower level of importance than <h1>
.
<h2>Section 1</h2>
These headings are used to further subdivide content within their parent headings, with <h3>
being more important than <h4>
, and so on.
<h3>Subsection 1.1</h3>
<h4>Subsection 1.1.1</h4>
Each HTML heading has a default size. However, you can specify the size for any heading with the style attribute, using the CSS font-size
property:
h1 {
font-size: 36px;
}
h2 {
font-size: 30px;
}
h3 {
font-size: 24px;
}
h4 {
font-size: 18px;
}
h5 {
font-size: 14px;
}
h6 {
font-size: 12px;
}