Skip to content

Instantly share code, notes, and snippets.

@acidtone
Last active January 24, 2021 22:34
Show Gist options
  • Save acidtone/4186780344d39f280f4d20720534737e to your computer and use it in GitHub Desktop.
Save acidtone/4186780344d39f280f4d20720534737e to your computer and use it in GitHub Desktop.
<aside> element: What's it for?

Aside: Proper Use

In HTML5, aside is only "related to the content around the aside element".

In HTML 5.1 (CR) the definition became more specific: aside is "related to the content of the parenting sectioning content".

Following the newer definition, the aside element should be inside of the section element to which it is related.

Sectioning elements

  • body
  • header
  • footer
  • nav
  • article
  • section
  • aside

Attributions

<body>
<main>
<article>
<aside><!-- related to the article --></aside>
<section>
<aside><!-- related to the section --></aside>
<div>
<aside><!-- related to the section (not to the div!) --></aside>
</div>
</section>
</article>
<aside><!-- related to the body (not to the main!) --></aside>
</main>
<aside>
<!-- related to the body -->
<aside><!-- related to the (parent) aside --></aside>
</aside>
<nav>
<aside><!-- related to the nav --></aside>
</nav>
<footer>
<aside><!-- related to the footer --></aside>
</footer>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment