Complete the code to add the main title of a webpage using the correct header tag.
<[1]>Welcome to My Website</[1]>
or for the main title instead of .
.
tags for headings.
The main title of a webpage should use the h1 tag to indicate the highest level heading.
Complete the code to add a subheading under the main title using the correct header tag.
<h1>Main Title</h1> <[1]>Subheading Section</[1]>
again for subheadings.
Subheadings under the main title should use the h2 tag to show the next level in the hierarchy.
Fix the error in the header tag hierarchy by choosing the correct tag for a subsection under an <h2> heading.
<h1>Main Title</h1> <h2>Section Title</h2> <[1]>Subsection Title</[1]>
or again for subsections.
Subsections under an h2 heading should use h3 to maintain proper hierarchy.
Fill both blanks to create a correct header hierarchy with a main title and a subsection.
<[1]>Website Title</[1]> <[2]>Details Section</[2]>
The main title uses h1 and the subsection uses h3 to show a nested structure under an implied
.
Fill all three blanks to create a proper header hierarchy with a main title, a section, and a subsection.
<[1]>Home Page</[1]> <[2]>About Us</[2]> <[3]>Our Team</[3]>
The main title uses h1, the section uses h2, and the subsection uses h3 to maintain a clear and accessible header structure.
Practice
Solution
Step 1: Understand header tag purpose
TheH1tag is designed for the main title or most important heading on a webpage.Step 2: Identify correct tag for main title
Since the main title is the highest level heading,H1is the correct choice.Final Answer:
<H1> -> Option AQuick Check:
Main title = <H1> [OK]
- Using H2 or H3 for main title
- Using multiple H1 tags for different sections
- Confusing header levels
Solution
Step 1: Recall HTML header tag syntax
HTML header tags use the format <hN> where N is the level number.Step 2: Identify second-level header tag
The second-level header is represented by <h2> and must be closed with </h2>.Final Answer:
<h2>Section Title</h2> -> Option AQuick Check:
Second-level header = <h2> [OK]
- Using incorrect tag names like <header2>
- Mixing header levels in syntax
- Forgetting closing tags
<h1>Welcome</h1> <h3>Introduction</h3> <h2>About Us</h2>
What is wrong with the header hierarchy?
Solution
Step 1: Review header tag order importance
Header tags should follow a logical order: H1, then H2, then H3, etc., to show content structure.Step 2: Analyze given snippet order
The snippet uses H1, then H3, then H2. The H3 appears before H2, which breaks the hierarchy.Final Answer:
The <H3> tag should not come before <H2> -> Option DQuick Check:
Header order must be H1 > H2 > H3 [OK]
- Ignoring header order importance
- Thinking any order is fine
- Replacing H1 with lower headers incorrectly
<h1>Title</h1> <h2>Section 1</h2> <h4>Subsection</h4>
What is the problem and how to fix it?
Solution
Step 1: Check header levels for hierarchy
Headers should increase by one level at a time to keep structure clear.Step 2: Identify skipped header level
The snippet jumps from H2 to H4, skipping H3, which breaks hierarchy.Step 3: Fix the skipped level
Change the H4 tag to H3 to maintain proper order.Final Answer:
Use <H3> instead of <H4> for the subsection -> Option CQuick Check:
Headers must not skip levels [OK]
- Skipping header levels
- Changing higher-level headers incorrectly
- Ignoring hierarchy rules
Solution
Step 1: Understand header tag levels and their meaning
H1 is the highest level for main titles, H2 for main sections, and H3 for subsections under those sections.Step 2: Match header tags to content structure
Using H1 for the main title, H2 for each section, and H3 for subsections keeps a clear, logical hierarchy.Final Answer:
H1 for main title, H2 for sections, H3 for subsections -> Option BQuick Check:
Hierarchy: H1 > H2 > H3 [OK]
- Mixing header levels incorrectly
- Using lower headers for main titles
- Skipping header levels in structure
