In HTML5, it is only defined that aside "linked to the content around the aside element".
In HTML 5.1 (CR), the definition has become more specific since it now says that aside “related to the content of the content of the parenting section”.
Following the new definition, the aside element must be inside the element of the section with which it is associated. The main element is not a sectioning element (elements such as article , section , body , figure , etc.). Of course, you can put aside in main , but it will be associated with the closest parent of the section main element.
This means that in these two examples there is no semantic difference (for aside ):
<body> <main></main> <aside></aside> </body>
<body> <main><aside></aside></main> </body>
An example that shows several different cases:
<body> <main> <article> <aside></aside> <section> <aside></aside> <blockquote> <aside></aside> </blockquote> <div> <aside></aside> </div> </section> </article> <aside></aside> </main> <aside> <aside></aside> </aside> <nav> <aside></aside> </nav> <footer> <aside></aside> </footer> </body>
source share