HTML Tags: 'section', 'article', and 'aside'

HTML5 introduced several new semantic elements to improve the structure and readability of web documents. Among these are the ‘<section>‘, ‘<article>‘, and ‘<aside>‘ elements. Each serves a specific purpose in organizing content.

1. 'section'

Definition:

The ‘<section>‘ element represents a generic standalone section of a document, which usually comes with its own heading. It’s used to group together related content and is typically thematic. This could be a chapter, a group of articles, or any other part of a document that can be grouped together under a common theme.

Usage:

  • Used for structuring a large document into smaller, thematic sections.
  • Typically contains a heading (‘<h1>‘ to ‘<h6>‘).
  • Can be nested inside other sections.

Example:

				
					<section>
    <h2>Introduction to Web Development</h2>
    <p>Web development is a field that involves building websites and applications for the internet or an intranet.</p>
</section>

<section>
    <h2>Frontend Technologies</h2>
    <p>Frontend development focuses on the visual and interactive aspects of a website.</p>
</section>

<section>
    <h2>Backend Technologies</h2>
    <p>Backend development is concerned with the server side, databases, and server logic.</p>
</section>

				
			

In this example, each ‘<section>‘ element groups content related to a specific part of a document about web development.

2. 'article'

Definition:

The ‘<article>‘ element represents a self-contained piece of content that could be distributed or republished independently. This could be a blog post, a news article, a forum post, or any other piece of content that stands on its own.

Usage:

  • Used for content that could be independently distributed or syndicated.
  • Often contains a heading, author information, date, and main content.
  • Can be nested inside other ‘<article>‘ elements.

Example:

				
					<article>
    <header>
        <h1>Understanding HTML5 Semantics</h1>
        <p>By John Doe, August 10, 2024</p>
    </header>
    <p>HTML5 introduced several new semantic elements like &lt;section&gt;, &lt;article&gt;, and &lt;aside&gt;. Understanding these elements is crucial for creating well-structured and accessible web pages.</p>
    <footer>
        <p>Posted in <a href="/category/html">HTML</a></p>
    </footer>
</article>

<article>
    <header>
        <h1>Best Practices for Web Accessibility</h1>
        <p>By Jane Smith, August 9, 2024</p>
    </header>
    <p>Web accessibility is about making websites usable for everyone, including people with disabilities. This article covers best practices for building accessible websites.</p>
    <footer>
        <p>Posted in <a href="/category/accessibility">Accessibility</a></p>
    </footer>
</article>

				
			

In this example, each ‘<article>‘ element contains a self-contained piece of content that could be shared or republished on its own.

3. 'aside'

Definition:

The ‘<aside>‘ element represents content that is tangentially related to the content around it. It is often used for sidebars, pull quotes, or other content that complements the main content but is not essential to it.

Usage:

  • Used for content like sidebars, pull quotes, or related links.
  • Typically placed alongside the main content but not integral to the main flow.
  • Can be used inside ‘<article>‘, ‘<section>‘, or outside them.

Example:

				
					<article>
    <h1>The Rise of JavaScript Frameworks</h1>
    <p>JavaScript frameworks have become essential tools for modern web development. They provide a structured way to build complex applications.</p>

    <aside>
        <h2>Related Frameworks</h2>
        <ul>
            <li><a href="https://reactjs.org/" target="_blank" rel="noopener">React</a></li>
            <li><a href="https://vuejs.org/" target="_blank" rel="noopener">Vue.js</a></li>
            <li><a href="https://angular.io/" target="_blank" rel="noopener">Angular</a></li>
        </ul>
    </aside>

    <p>The choice of framework often depends on the project requirements and the developer's familiarity with the tool.</p>
</article>

				
			

In this example, the ‘<aside>‘ element is used to display related frameworks, which is additional content that complements the main article but isn’t essential to the understanding of it.

  • <section>: Groups related thematic content, often with a heading.
  • <article>: Represents a self-contained, independent piece of content.
  • <aside>: Contains tangentially related content, often displayed in a sidebar.

These elements are crucial for creating well-structured and accessible web pages, helping both users and search engines understand the hierarchy and organization of content.

Scroll to Top