What is the purpose of the <header> element in HTML?
The <header> element defines the introductory content or a set of navigational links for a page or section. It usually contains the site title, logo, and main navigation.
Click to reveal answer
beginner
What role does the <footer> element play in a webpage?
The <footer> element represents the footer for its nearest sectioning content or sectioning root element. It often contains information like copyright, contact links, or related documents.
Click to reveal answer
beginner
Why should you use the <main> element in your HTML?
The <main> element is used to wrap the main content of the document. It helps screen readers and browsers understand where the primary content is, improving accessibility.
Click to reveal answer
intermediate
Can a webpage have multiple <header> or <footer> elements?
Yes, a webpage can have multiple <header> and <footer> elements if they belong to different sections or articles. Each section can have its own header and footer.
Click to reveal answer
intermediate
How do <header>, <main>, and <footer> improve web accessibility?
These elements provide clear landmarks for assistive technologies, helping users navigate the page easily by jumping to main content, headers, or footers.
Click to reveal answer
Which HTML element is best for wrapping the main content of a webpage?
A<main>
B<section>
C<article>
D<div>
✗ Incorrect
The element specifically marks the main content of the page, helping browsers and assistive devices.
Where would you typically place the <footer> element?
AInside the <nav> element
BInside the <head> section
CAt the top of the page
DAt the bottom of the page or section
✗ Incorrect
The
Can the <header> element contain navigation links?
AYes, it often contains navigation links
BNo, navigation must be outside <header>
COnly if inside a <nav> element
DOnly in the <footer>
✗ Incorrect
The often includes navigation links to help users find their way.
Which element helps screen readers identify the main content area?
A<footer>
B<header>
C<main>
D<aside>
✗ Incorrect
The element signals the primary content to assistive technologies.
Is it valid to have multiple <main> elements on one webpage?
AYes, for different sections
BNo, only one <main> per page
COnly if inside <article>
DOnly if inside <section>
✗ Incorrect
Only one element should be used per page to avoid confusion.
Explain the roles of , , and
Think about the top, middle, and bottom parts of a webpage.
You got /3 concepts.
Describe how using semantic elements like , , and
Consider how clear page sections help people who can't see the page visually.
You got /3 concepts.
Practice
(1/5)
1. Which HTML element is best used to contain the main content unique to a webpage?
easy
A. <section>
B. <header>
C. <footer>
D. <main>
Solution
Step 1: Understand the purpose of <main>
The <main> element is designed to hold the main content that is unique to the page, excluding repeated content like headers or footers.
Step 2: Compare with other elements
<header> is for top parts like titles or menus, <footer> is for bottom parts like contact info, and <section> is a generic container but not specifically for main content.
Final Answer:
<main> -> Option D
Quick Check:
Main content = <main> [OK]
Hint: Main content always goes inside <main> tag [OK]
Common Mistakes:
Using <section> instead of <main> for main content
Putting main content inside <header> or <footer>
Confusing <main> with <article>
2. Which of the following is the correct syntax to create a footer section in HTML5?
easy
A. Contact us at email@example.com
B.
C. Contact us at email@example.com
D. Contact us at email@example.com
Solution
Step 1: Identify the correct HTML5 footer tag
The correct tag for footer content is <footer>. Tags like <foot>, <bottom>, and <end> do not exist in HTML5.
Step 2: Confirm the syntax
The syntax <footer>...</footer> correctly wraps footer content.
Final Answer:
<footer>Contact us at email@example.com</footer> -> Option B
Quick Check:
Footer tag = <footer> [OK]
Hint: Footer tag is exactly <footer> in HTML5 [OK]
Common Mistakes:
Using non-existent tags like <foot> or <bottom>
Misspelling the footer tag
Using <div> without semantic meaning
3. What will be the visual order of content in the browser for this HTML snippet?
<header>Site Title</header>
<main>Welcome to our website</main>
<footer>Contact info</footer>
medium
A. Site Title at top, Welcome message in middle, Contact info at bottom
B. Contact info at top, Site Title in middle, Welcome message at bottom
C. Welcome message at top, Contact info in middle, Site Title at bottom
D. All content mixed randomly
Solution
Step 1: Understand semantic order of header, main, footer
The <header> appears first and is shown at the top, <main> is the main content in the middle, and <footer> is at the bottom.
Step 2: Visualize the content placement
Content inside <header> shows "Site Title" at top, <main> shows "Welcome to our website" in the middle, and <footer> shows "Contact info" at the bottom.
Final Answer:
Site Title at top, Welcome message in middle, Contact info at bottom -> Option A
Quick Check:
Header top, main middle, footer bottom [OK]
Hint: Header top, main center, footer bottom visually [OK]
Step 1: Check each tag for proper opening and closing
The <header> and <main> tags are correctly opened and closed. The <footer> tag is opened but closed incorrectly as <footer> instead of </footer>.
Step 2: Identify the specific error
The footer closing tag is missing the slash, causing invalid HTML.
Final Answer:
The closing tag for footer is incorrect -> Option C
Quick Check:
Footer closing tag must be </footer> [OK]
Hint: Closing tags need a slash, e.g. [OK]
Common Mistakes:
Forgetting slash in closing tags
Confusing opening and closing tags
Assuming missing tags instead of wrong closing
5. You want to create a webpage with a header containing a navigation menu, a main section with an article, and a footer with copyright info. Which is the best semantic HTML structure?
The header should contain the navigation menu inside <nav>. The main content should be inside <main> with an <article>. The footer should have copyright info inside <footer>.
Step 2: Check each option for correct semantic structure