Junior
What is the difference between the `<aside>`, `<article>`, and `<section>` elements in HTML?
sobes.tech AI
Answer from AI
<article>: A self-contained, independent piece of content that can be distributed and reused outside the current page context (e.g., a blog post, news, comment). It should have a heading inside.<section>: A thematic section of the page content. Usually has a heading (<h1>-<h6>) and groups related content. It should not be used just for styling — for that,<div>is used.<aside>: Content indirectly related to the main content of the page. Often used for side panels, inserts, advertisements, or quotes.
Comparison in a table:
| Element | Purpose | Self-contained | Requires a heading (not strictly, but recommended) |
|---|---|---|---|
<article> |
Independent, portable content | Yes | Recommended |
<section> |
Thematic section within a document | No | Recommended |
<aside> |
Indirectly related content (sidebar) | No | No |