Coding Now – Best AI & Full Stack Courses in Delhi NCR | 100% Placement
Limited Offer: Get 50% OFF on AI & Full Stack Courses
📞 Call Now: +91 9667708830
Back to HTML Notes
Topic #806

The article Element

The <article> element marks content that could be lifted out of the page and would still make complete sense on its own — a blog post, a news story, a product card, a single comment.

Syntax & Example

<article>
    <h2>5 Tips for Learning Python</h2>
    <p>Published on 12 August 2026</p>
    <p>Start with the basics before jumping into frameworks...</p>
</article>

The "Would It Make Sense in an RSS Feed?" Test

If you syndicated this piece of content on its own — in an RSS feed, on another site, shared as a standalone snippet — would it still make sense without the rest of the page around it? A blog post: yes. A single sidebar widget showing "recent posts": no, that's an aside, not an article.

Articles Can Nest

<article>
    <h2>5 Tips for Learning Python</h2>
    <p>Start with the basics...</p>

    <article>
        <h3>Comment from Priya</h3>
        <p>This helped me a lot, thanks!</p>
    </article>
</article>

Each comment is itself self-contained content, so nesting <article> inside <article> is valid and common for comment threads.

Practical Use Case

Blog posts, news articles, forum posts, individual product cards in a grid, and user comments are all legitimate <article> use cases.

Common Mistakes

  • Using <article> for content that only makes sense in context of the surrounding page (like a sidebar widget) — that belongs in <aside> or a plain <div>
  • Using <section> and <article> interchangeably — see article vs section for the precise distinction

Interview Relevance

"When would you use article instead of section?" — the standalone/syndication test above is the clearest way to answer this correctly.

Practice Question

Mark up a grid of 3 product cards using <article> for each card, with a heading, price, and description.

Related HTML Notes

Want to go beyond the notes?

Join CodingNow's HTML course — live mentorship, real projects, and 100% placement support.

Enroll Now — Free Demo Available
💬 Talk to Advisor
1
WhatsApp

Latest from Our Blog

Insights on AI, Data Science, Full Stack & Career

View All Articles →