Nearby lessons
5 of 24π HTML Headings
π What are HTML Headings?
HTML heading tags (
<h1> to <h6>) help organize your content. They improve accessibility, SEO, and make your page easier to read. HTML heading tags (<h1> to <h6>) are used to define titles and subtitles. Just like books have chapters and sub-chapters, web pages use headings to show importance. <h1> is the most important, and <h6> is the least.β Heading Best Practices
- Use only one
<h1>per page (main title). - Use headings in order (don't jump from
<h1>to<h4>). - Headings should describe the content below them.
- Don't choose headings based on sizeβuse them for structure, not style.
- Use CSS to style headings (change color, font, etc.) instead of misusing levels.
π Default HTML Heading Sizes
| Attribute | Description |
|---|---|
<h1> | π΄ 2em (32px) β Main page title |
<h2> | π 1.5em (24px) β Section heading |
<h3> | π‘ 1.17em (18.72px) β Sub-section |
<h4> | π’ 1em (16px) β Minor heading |
<h5> | π΅ 0.83em (13.28px) β Small heading |
<h6> | π£ 0.67em (10.72px) β Least important |
π‘ HTML Headings Code Example
Code Example
PREVIEW READY
π§ Test Your Knowledge
5 QuestionsProgress: 0 / 5
Keep Going!HTML Comments