By Fatskills Exam Guides Team — the exam nerds behind 28,500+ quizzes and 2.1M practice questions across 500+ global exams.
Semantic elements are HTML5 tags that clearly describe their meaning in a human- and machine-readable way. They include header, nav, main, article, section, aside, and footer. These elements are crucial for web design because they enhance accessibility, improve SEO, and make your code more maintainable. Incorrect usage can lead to poor user experience, especially for those relying on screen readers, and can negatively impact your website's search engine ranking. For instance, misusing a nav element for non-navigation content can confuse both users and search engines, leading to navigation issues and lower search visibility.
Example: <main> contains the primary article or blog post. ⚠️ Common pitfall: Avoid nesting multiple main elements within the same page.
<main>
Structure the header:
<header>
Underlying principle: The header provides context for the page.
Create navigation links:
<nav>
Underlying principle: The nav element helps users navigate the site efficiently.
Organize self-contained content:
<article>
Underlying principle: The article element is useful for syndication and distribution.
Group related content:
<section>
Underlying principle: The section element helps organize and categorize content.
Add sidebar content:
<aside>
Underlying principle: The aside element separates sidebar content from the main content.
Include footer content:
<footer>
Experts view semantic elements as a way to enhance the semantic structure of a webpage. Instead of merely organizing content visually, they think about how each element contributes to the overall meaning and accessibility of the page. This perspective helps them create more intuitive and user-friendly designs.
Exam trap: Questions may ask for the best element to use in a given context.
The mistake: Nesting multiple main elements.
Exam trap: Scenarios with multiple main elements to identify the correct usage.
The mistake: Using section for styling purposes.
Exam trap: Questions about the proper use of section vs. div.
The mistake: Placing unrelated content in aside.
Scenario: You are designing a blog page with a header, navigation menu, main content area, sidebar, and footer.Question: Which semantic elements should you use for each part of the page? Solution: 1. Use header for the header section.2. Use nav for the navigation menu.3. Use main for the main content area.4. Use aside for the sidebar.5. Use footer for the footer.Answer: header, nav, main, aside, footer.Why it works: Each element clearly describes its purpose, enhancing accessibility and SEO.
Scenario: You are creating a news website with multiple articles and sections.Question: How should you structure the articles and sections? Solution: 1. Use article for each news article.2. Use section to group related articles.Answer: article, section.Why it works: article elements are self-contained, and section elements group related content.
Join 4M+ learners. Unlock unlimited quizzes, wrong-answer tracking, flashcards + reminders, study guides, and 1-on-1 challenges.