Student: Majharul Islam | ID: 232002256 | Date: October 2025
Semantic elements clearly describe their meaning in a human- and machine-readable way. HTML5 introduced new semantic elements that provide better document structure and accessibility.
Represents introductory content or navigational aids for its nearest ancestor.
<header>
<h1>Website Title</h1>
<nav>Navigation</nav>
</header>
Use for: Page headers, section headers, article headers
Represents a section of a page that links to other pages or parts within the page.
<nav>
<ul>
<li><a href="home.html">Home</a></li>
<li><a href="about.html">About</a></li>
</ul>
</nav>
Use for: Main navigation, breadcrumbs, pagination
Represents the dominant content of the document. Only one per page.
<main>
<h1>Main Content</h1>
<p>Primary content of the page</p>
</main>
Use for: Primary content area (not in header, footer, or aside)
Represents a footer for its nearest ancestor sectioning content.
<footer>
<p>© 2025 Company Name</p>
<nav>Footer links</nav>
</footer>
Use for: Page footers, article footers, contact info
Represents a standalone section of content that forms a complete, or self-contained, composition.
<section>
<h2>Chapter 1</h2>
<p>Section content</p>
</section>
Use for: Thematic grouping of content, chapters, tabs
Represents a self-contained composition in a document that is independently distributable.
<article>
<header>
<h1>Article Title</h1>
</header>
<p>Article content</p>
</article>
Use for: Blog posts, news articles, forum posts
Represents a portion of a document whose content is only indirectly related to the main content.
<aside>
<h3>Related Links</h3>
<ul>
<li><a href="#">Related Article 1</a></li>
</ul>
</aside>
Use for: Sidebars, related content, advertisements
Represents self-contained content, potentially with an optional caption.
<figure>
<img src="chart.png" alt="Sales Chart">
<figcaption>Figure 1: Sales Data</figcaption>
</figure>
Use for: Images, diagrams, code snippets with captions
Represents a caption or legend for the rest of the contents of its parent figure element.
<figcaption>
Figure 1: This shows the sales data for Q1 2025
</figcaption>
Use for: Descriptions of figures, images, or diagrams
Represents a specific period in time. May include the datetime attribute.
<time datetime="2025-10-01">October 1, 2025</time>
<time datetime="14:30">2:30 PM</time>
Use for: Dates, times, durations with machine-readable format
Represents the contact information for its nearest article or body element ancestor.
<address>
Written by <a href="mailto:author@example.com">Author Name</a><br>
Visit us at:<br>
Example.com<br>
123 Main St, City, Country
</address>
Use for: Contact information, author details
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Semantic HTML5 Example</title>
</head>
<body>
<header>
<h1>My Blog</h1>
<nav>
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="about.html">About</a></li>
<li><a href="contact.html">Contact</a></li>
</ul>
</nav>
</header>
<main>
<article>
<header>
<h1>Understanding Semantic HTML5</h1>
<p>Published on <time datetime="2025-10-01">October 1, 2025</time></p>
</header>
<section>
<h2>What are Semantic Elements?</h2>
<p>Semantic elements provide meaning to the content...</p>
<figure>
<img src="semantic-diagram.png" alt="Semantic HTML structure diagram">
<figcaption>Figure 1: Semantic HTML document structure</figcaption>
</figure>
</section>
<section>
<h2>Benefits of Semantic HTML</h2>
<p>There are several advantages to using semantic elements...</p>
</section>
<footer>
<address>
Written by <a href="mailto:author@example.com">John Doe</a><br>
Contact: <a href="tel:+1234567890">(123) 456-7890</a>
</address>
</footer>
</article>
<aside>
<h3>Related Articles</h3>
<ul>
<li><a href="css-basics.html">CSS Basics</a></li>
<li><a href="javascript-intro.html">JavaScript Introduction</a></li>
</ul>
</aside>
</main>
<footer>
<p>© 2025 My Blog. All rights reserved.</p>
<nav>
<a href="privacy.html">Privacy Policy</a> |
<a href="terms.html">Terms of Service</a>
</nav>
</footer>
</body>
</html>
Related information
<div id="header">
<h1>Website Title</h1>
<div class="nav">Navigation</div>
</div>
<div id="main">
<div class="post">
<h2>Post Title</h2>
<p>Post content</p>
</div>
<div class="sidebar">Sidebar</div>
</div>
<div id="footer">Footer</div>
<header>
<h1>Website Title</h1>
<nav>Navigation</nav>
</header>
<main>
<article>
<h2>Post Title</h2>
<p>Post content</p>
</article>
<aside>Sidebar</aside>
</main>
<footer>Footer</footer>
| Element | Screen Reader Support | Navigation Aid |
|---|---|---|
| <header> | Identifies page header | Landmark navigation |
| <nav> | Identifies navigation areas | Quick navigation access |
| <main> | Identifies main content | Skip to main content |
| <article> | Identifies article content | Article navigation |
| <section> | Identifies content sections | Section navigation |
| <aside> | Identifies sidebar content | Complementary content |