Beginner LevelHTML & Semantic Web
What is the difference between <section> and <article> elements?
❓ Interview Prompt: Compare <article> (independently reusable content) vs <section> (thematic document grouping).
1. '<article>':
Represents a self-contained, independently distributable or reusable composition (e.g. blog post, news article, forum comment, product card). Could be syndicated in an RSS feed standalone!
2. '<section>':
Represents a generic thematic grouping of content, typically with a heading ('<h2>'-'<h6>'). Used to divide long pages into logical thematic sub-topics.
Code Implementation Example
html
<article>
<h2>Understanding Web Vitals</h2>
<section>
<h3>Largest Contentful Paint (LCP)</h3>
<p>LCP measures loading performance...</p>
</section>
</article>💡Nesting thematic <section> containers inside an independent <article>.
🎯 Interview Key Takeaway
Use <article> for standalone reusable content, and <section> to divide documents into thematic topics.
#article#section#Semantics#Beginner
Back to all HTML & Semantic Web Questions→