• in
InterCourses
CoursesBlogs
0
← Introduction to HTML
○What is HTML?○Elements, Tags, and Attributes○Your First Complete Page
○Headings and Comments○Paragraphs, Emphasis, and Line Breaks○HTML Lists
○Hyperlinks○Images○Applying Styles to HTML
○Div and Span○HTML Tables○Classes and IDs
○Project 1 - Visiting Card Structure○Project 1 - Visiting Card Actions
○The Head Element and Page Title○Meta Tags○HTML Entities
○HTML Forms○Input Types○Checkboxes and Radio Buttons○Textarea and Select
○Embedding Video○Embedding Audio○Iframes
●Semantic HTML Tags○Details, Figure, and Figcaption
○Project 3 - Resume Semantic Structure○Project 3 - Resume Links and Actions

Semantic HTML Tags

Semantic HTML uses tags that describe their meaning — not just their appearance. This benefits:

  • Accessibility: Screen readers navigate by landmarks (<nav>, <main>, <footer>)
  • SEO: Search engines better understand page structure
  • Readability: Other developers immediately understand the layout

Page landmarks

html
<!DOCTYPE html>
<html lang="en">
<head>...</head>
<body>
    <header>
        <h1>Site Name</h1>
        <nav>
            <a href="/">Home</a>
            <a href="/about">About</a>
        </nav>
    </header>

    <main>
        <article>
            <h2>Article Title</h2>
            <p>Article content...</p>
        </article>
        <aside>
            <h3>Related Links</h3>
        </aside>
    </main>

    <footer>
        <p>&copy; 2024 Site Name</p>
    </footer>
</body>
</html>

Landmark elements

ElementPurpose
<header>Introductory content — site/page/section header
<nav>Navigation links
<main>Primary content (one per page)
<article>Self-contained, re-distributable content
<section>Thematic grouping of content
<aside>Tangentially related content (sidebars)
<footer>Closing content — copyright, links, contact

<article> vs <section>

  • <article> is for content that could be removed from the page and still make sense on its own — a blog post, a comment, a news story.
  • <section> groups related content that is part of the page, not independently meaningful.

Text semantics

html
<!-- A quotation from another source -->
<blockquote cite="https://example.com/source">
    <p>The best way to predict the future is to invent it.</p>
</blockquote>

<!-- A specific date/time -->
<p>Published on <time datetime="2024-01-15">January 15, 2024</time></p>

<!-- Contact information for the nearest article/body -->
<address>
    Written by <a href="mailto:jane@example.com">Jane Smith</a>
</address>

Your Task

Build a semantic blog post page:

  1. Add a <header> element.
  2. Inside the header, add a <nav> with at least two links.
  3. Add a <main> element.
  4. Inside main, add an <article> with a heading and at least two paragraphs.
  5. Inside the article, include a <time> element with a datetime attribute.
  6. Add an <aside> next to the article with related links.
  7. Add a <footer> element.
Hint 1
1 / 4
HINT 1

Use <main> for the primary content area — there should only be one per page.

Loading editor…
READY
intercourses
html