HTML aside Element

HTML <aside> Element: Meaningful Side Notes

In writing, we often pull readers aside to offer tips, fun facts, or links that enhance the main content. In HTML, the <aside> element does the same — it holds content that is related, but not essential to the primary flow.

What Is the <aside> Element?

The <aside> element represents tangential content. It’s often used for sidebars, widgets, related links, pull quotes, or background context. It can be placed inside the main content or outside of it, depending on the context.

Basic Syntax

<aside>
  <h3>Did You Know?</h3>
  <p>Bananas are technically berries, but strawberries are not!</p>
</aside>
Did You Know?  
Bananas are technically berries, but strawberries are not!

Typical Uses of <aside>

  • Blog post sidebars
  • Related articles or external links
  • Author bios or ads
  • Definitions or glossary terms
  • Callouts and helpful hints

Example: Article with Sidebar

<main>

  <article>
    <h2>Cherry Health Benefits</h2>
    <p>Cherries are rich in antioxidants and help reduce inflammation.</p>
  </article>

  <aside>
    <h3>Related Links</h3>
    <ul>
      <li><a href="/apple-benefits">Benefits of Apples</a></li>
      <li><a href="/banana-energy">Bananas for Energy</a></li>
    </ul>
  </aside>

</main>
Cherry Health Benefits  
Cherries are rich in antioxidants...

Sidebar:  
• Benefits of Apples  
• Bananas for Energy

Here, the <aside> is placed within the page layout, offering helpful but non-essential info.

Inside vs Outside the Main Content

You can use <aside> both inside an <article> or outside it. Placement changes how it’s interpreted:

  • Inside <article>: related to that article specifically
  • Outside <article>: related to the whole page or site

Example: Embedded Aside in Article

<article>
  <h2>Exploring the World of Bananas</h2>
  <p>Bananas are a global fruit with deep roots in history...</p>

  <aside>
    <p>Tip: To speed up ripening, store bananas in a paper bag.</p>
  </aside>

</article>

ARIA & Accessibility

<aside> is already semantic, but for clarity, you can use aria-labelledby to link it to a heading inside it.

<aside aria-labelledby="related-heading">
  <h3 id="related-heading">Related Articles</h3>
  <ul>
    <li><a href="/fruits/apple">All About Apples</a></li>
  </ul>
</aside>

Best Practices

  • Use <aside> for content that enhances but isn’t vital to the main narrative
  • Always include a heading inside your aside for clarity
  • Don’t use it for layout or structural purposes — keep it contextual

Summary

The <aside> element brings balance to your content — offering helpful details without crowding the spotlight. You've now learned how to:

  • Use <aside> for sidebars, links, and supplemental content
  • Structure it inside or outside main content appropriately
  • Enhance accessibility with semantic structure and ARIA labels

Check your understanding 1

What is the primary purpose of the <aside> element in HTML?
Choose one answer. You can try again.

Answer and explanation

To contain content tangentially related to the main content

The <aside> element is designed to hold complementary or related information, such as sidebars, pull quotes, or related links, which are not the main focus but add context.

Check your understanding 2

Content inside the <aside> tag should be directly relevant and essential to the main topic of the page.
Choose one answer. You can try again.

Answer and explanation

False

Content in <aside> is complementary or tangential to the main content; it enhances but is not essential.

Check your understanding 3

Choose the option that lists all and only the correct statements.

  1. Sidebars with related links
  2. Advertisements
  3. Main article content
  4. Pull quotes or notes
Which of the following are typical uses for the <aside> element?
Choose one answer. You can try again.

Answer and explanation

Statements 1 and 2 and 4

<aside> is often used for sidebars, related links, advertisements, and notes that provide additional context without being part of the primary content.

Check your understanding 4

Which ARIA role is most appropriate to assign to the <aside> element for accessibility?
Choose one answer. You can try again.

Answer and explanation

complementary

The ARIA role complementary is used with <aside> to signify content that complements the main content.

Check your understanding 5

Using the <aside> element inside an <article> is semantically correct when adding related info to that article.
Choose one answer. You can try again.

Answer and explanation

True

An <aside> inside an <article> is a common pattern for including tangential information related specifically to that article.

Check your understanding 6

Choose the option that lists all and only the correct statements.

  1. Using it for unrelated advertisements
  2. Including it for tangential information or notes
  3. Using it as a sidebar for related content
  4. Embedding primary navigation menus
Which of the following is NOT a recommended practice when using the <aside> element?
Choose one answer. You can try again.

Answer and explanation

Statements 1 and 4

While <aside> can contain related ads, unrelated advertisements and primary navigation menus are not recommended inside <aside>.

What’s Next?

Next, we’ll explore the <main> element — the core container for your primary page content.

Reaching the recap and completing the quizzes are separate milestones.

    Next lesson: HTML main Element →