Headings help organize content on a webpage. They show what each section is about in a clear way.
Headings (h1–h6) in HTML
<h1>Heading text</h1> <h2>Subheading text</h2> <h3>Smaller subheading</h3> ... <h6>Smallest heading</h6>
Use <h1> for the main title, then <h2> for subsections, and so on.
Headings go from h1 (biggest) to h6 (smallest).
<h1>Welcome to My Website</h1>
<h2>About Us</h2>
<h3>Our Team</h3>
<h4>Contact Info</h4>
This page uses headings from h1 to h4 to organize content clearly. The main title is h1. Sections like Breakfast and Dinner use h2. Recipes inside use h3. The footer has a smaller heading h4.
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Heading Example</title> </head> <body> <header> <h1>My Favorite Recipes</h1> </header> <main> <section> <h2>Breakfast</h2> <article> <h3>Pancakes</h3> <p>Fluffy and easy to make.</p> </article> <article> <h3>Omelette</h3> <p>Quick and healthy.</p> </article> </section> <section> <h2>Dinner</h2> <article> <h3>Spaghetti</h3> <p>Classic Italian pasta.</p> </article> </section> </main> <footer> <h4>Contact Us</h4> <p>Email: info@example.com</p> </footer> </body> </html>
Always use headings in order. Don't jump from h1 to h4 without h2 or h3 in between.
Headings improve page readability and help people who use screen readers.
Use CSS to style headings if you want different colors or fonts, but keep the heading tags for structure.
Headings organize your page content from big (h1) to small (h6).
Use headings to make your page easy to read and understand.
Proper heading order helps accessibility and SEO.
Practice
Solution
Step 1: Understand heading sizes
HTML headings range from<h1>(largest) to<h6>(smallest).Step 2: Identify the largest heading tag
The<h1>tag is the biggest and most important heading on a page.Final Answer:
<h1> -> Option BQuick Check:
Largest heading = <h1> [OK]
- Confusing h3 or h5 as largest heading
- Thinking h6 is the biggest heading
- Mixing heading tags with paragraph tags
Solution
Step 1: Recall heading tag syntax
HTML heading tags use the format<hN>...</hN>where N is a number 1 to 6.Step 2: Identify correct level 3 heading
The correct tag for level 3 heading is<h3>with matching closing tag</h3>.Final Answer:
<h3>Heading Text</h3> -> Option DQuick Check:
Correct syntax for h3 = <h3>...</h3> [OK]
- Using invalid tags like <heading3>
- Mismatched opening and closing tags
- Using numbers incorrectly like <h33>
<h1>Title</h1> <h4>Subtitle</h4> <h2>Section</h2>
Solution
Step 1: Understand heading size order
Heading sizes go from<h1>largest to<h6>smallest.Step 2: Compare given headings
<h1>Title is largest,<h2>Section is medium,<h4>Subtitle is smaller than h2.Final Answer:
Title is largest, Section is medium, Subtitle is smallest -> Option CQuick Check:
h1 > h2 > h4 sizes [OK]
- Assuming h4 is bigger than h2
- Thinking all headings have same size
- Mixing order of heading sizes
<h2>Welcome<h2>
Solution
Step 1: Check tag correctness
The opening tag is<h2>, but the closing tag is incorrectly written as<h2>instead of</h2>.Step 2: Identify proper closing tag
HTML requires closing tags to have a slash, so it should be</h2>to close the heading properly.Final Answer:
Missing closing tag should be </h2> -> Option AQuick Check:
Closing tags need slash / [OK]
- Forgetting the slash in closing tags
- Thinking heading tags can't have text
- Confusing tag names like h2 and h3
Solution
Step 1: Understand heading hierarchy
Headings should start with<h1>for main title, then<h2>for sections,<h3>for subtitles, and<h4>for sub-subtitles.Step 2: Check options for correct order
<h1>Main Title</h1>, <h2>Section</h2>, <h3>Subtitle</h3>, <h4>Sub-subtitle</h4>follows the correct descending order from h1 to h4, which helps screen readers and SEO understand content structure.Final Answer:
<h1>Main Title</h1>, <h2>Section</h2>, <h3>Subtitle</h3>, <h4>Sub-subtitle</h4> -> Option AQuick Check:
Proper heading order = h1, h2, h3, h4 [OK]
- Starting main title with h3 or lower
- Skipping heading levels randomly
- Using bigger numbers for main titles
Ready to prove it?
Pass the test and this pattern moves unknown
