CKTIS / HTML
HTML element: aside
The aside element marks content only indirectly related to its surrounding material, which can be separated without losing the main flow.
Version: WHATWG HTML Living Standard; index snapshot date recorded separately
Syntax
<aside><h2>Related context</h2>…</aside>aside suits a digression, pull quote, glossary, related links, or advertising when its relationship to the main content is tangential.
Placement in a side column alone does not justify aside; primary navigation still belongs in nav, while essential steps or warnings remain in the main content.
As a sectioning element it should have an identifiable topic, usually expressed by a heading such as h2, rather than being an anonymous styling container.
The example uses closest() to identify the owning article, reads its h3 heading, and counts the related a links.
Examples
<!doctype html>
<meta charset="utf-8">
<main id="main">
<article id="guide"><h2>HTML parsing</h2><p>Main explanation.</p>
<aside id="related"><h3>Related reading</h3><a href="#appendix">Parser appendix</a></aside>
</article>
</main>
<output id="result"></output>
<script>
const main = document.querySelector("#main");
const related = document.querySelector("#related");
document.querySelector("#result").textContent = `owner=${related.closest("article").id}; heading=${related.querySelector("h3").textContent}; links=${related.querySelectorAll("a").length}; inMain=${main.contains(related)}`;
</script>
Result
owner=guide; heading=Related reading; links=1; inMain=true
The result verifies the section’s DOM relationship and contents; it does not determine visual placement or editorial importance.