HTML <article> Tag

Beginner
⏱️ 7 min read
📚 Updated: Jun 2026
🎯 5 Examples
Semantic HTML

What You’ll Learn

By the end of this tutorial, you’ll confidently mark up self-contained content with semantic HTML in real-world projects.

01

Standalone Content

Identify when content belongs in <article> vs other sectioning elements.

02

Syntax & Structure

Wrap blog posts, news stories, and cards with headings and metadata.

03

article vs section

Apply the syndication test to choose the right semantic element.

04

Global Attributes

Use class, id, and lang for styling and identification.

05

Nesting Patterns

Embed comments and related items inside parent articles.

06

Accessibility & SEO

Landmarks, headings, and structured metadata for discoverability.

What Is the <article> Tag?

The article element (<article>) defines a standalone piece of content. Ask yourself: “Would this block still make sense if I pulled it out and published it elsewhere?” If yes, use <article>.

💡
HTML5 sectioning element

Typical uses include blog posts, news articles, magazine features, forum posts, and user-submitted comments nested inside a parent article. The browser exposes it as an article landmark for assistive technology.

Each article should include a meaningful heading (h1h6) and can contain <header>, <footer>, <time>, and other flow content.

📝 Syntax

Wrap standalone content between opening and closing <article> tags. Include a meaningful heading for accessibility and SEO:

syntax.html
<!-- Basic article syntax -->
<article>
  <h2>Article Title</h2>
  <p>Introduction to your article...</p>
  <!-- Additional content -->
</article>
  • <article> is a block-level flow element—not a void tag.
  • Every article needs a descriptive heading for screen readers and SEO.
  • Self-closing syntax (<article />) is not valid in HTML.

⚡ Quick Reference

AspectDetails
Tag-specific attributesNone — uses global attributes only
class / idTarget articles with CSS and JavaScript
NestingAllowed — comments and related items inside parent article
vs <section>article = distributable; section = thematic grouping
Landmark rolearticle — exposed to assistive technology
Common childrenh1h6, p, header, footer, time

⚖️ <article> vs <section>

Both are sectioning elements, but they serve different purposes:

ElementPurposeExample
<article>Self-contained, syndicatable contentBlog post, news story, product card
<section>Thematic group within a pageChapter, tab panel, grouped form fields
Rule of thumbIf it makes sense in an RSS feed alone, use article
AvoidDon’t use article for sidebars — use <aside> instead

🧰 Attributes

The <article> tag has no tag-specific attributes. Use global HTML attributes for styling and identification:

class / id Global

Target featured articles, blog cards, or news categories with CSS and JavaScript selectors.

<article class="featured-article" id="main-article">
lang Optional

Hints the language of the article when it differs from the page’s primary language.

lang="fr"
aria-labelledby A11y

Links the article landmark to its heading when multiple unnamed articles appear on one page.

aria-labelledby="post-title"
style / data-* Optional

Inline styling or custom data attributes for CMS templates and JavaScript hooks.

data-post-id="42"

Examples Gallery

Five real-world article patterns with copy-ready code, live previews, and hands-on practice.

👀 Live Preview

A simple article block as rendered in the browser:

Article Title

Introduction to your article. This content is wrapped in a semantic <article> element.

Basic Syntax

The simplest form: a heading and paragraph inside <article>.

basic-article.html
<article>
  <h2>Article Title</h2>
  <p>Introduction to your article...</p>
</article>

class & id Attributes

Apply class and id to target a featured article with CSS or JavaScript. Include an article-level <footer> for author and date metadata.

article.html
<article class="featured-article" id="main-article">
  <h2>The Importance of Learning HTML</h2>
  <p>HTML is the foundation of every website.</p>
  <footer>
    <p>Written by: Mari Selvan</p>
    <p>Published: June 7, 2026</p>
  </footer>
</article>
Try It Yourself

📚 Common Use Cases

Here are the most frequent ways developers use the <article> tag in real projects.

Blog Posts

Wrap each blog post in its own <article> on a listing page. Style each card with CSS for a polished blog feed layout.

blog-posts.html
<style>
  article {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  }
  article h2 { color: #1e40af; font-size: 1.125rem; }
</style>
<main>
  <article>
    <p class="post-meta">June 5, 2026</p>
    <h2>Blog Post Title</h2>
    <p>Content of your blog post...</p>
    <a href="#">Read more</a>
  </article>
</main>
Try It Yourself

News Articles

On a news homepage, each story is an independent <article>. Use CSS category classes and colored left borders to distinguish breaking, sports, and weather stories.

news-articles.html
<style>
  article.breaking { border-left-color: #dc2626; }
  article.sports { border-left-color: #2563eb; }
  article.weather { border-left-color: #d97706; }
</style>
<article class="breaking">
  <h2>Breaking News Title</h2>
  <p>Details of the breaking news...</p>
</article>
Try It Yourself

Structured Article with Metadata

Combine <header>, <time datetime>, body content, and an <address> in the article <footer> for a complete semantic structure.

structured-article.html
<article>
  <header>
    <h2>Getting Started with Semantic HTML</h2>
    <p>Published <time datetime="2026-06-07">June 7, 2026</time></p>
  </header>
  <p>Semantic HTML elements help browsers and search engines understand your content.</p>
  <footer>
    <address>Written by <a href="mailto:author@codetofun.com">Mari Selvan</a></address>
  </footer>
</article>
Try It Yourself

🔁 Nested Articles

An <article> can contain nested <article> elements for content related to the parent—most commonly user comments on a blog post:

nested-articles.html
<article>
  <h2>Blog Post Title</h2>
  <p>Main article content...</p>
  <section>
    <h3>Comments</h3>
    <article>
      <h4>Comment by Jane</h4>
      <p>Great article!</p>
    </article>
  </section>
</article>

♿ Accessibility

The <article> element creates an article landmark for screen readers. Follow these guidelines:

  • Heading — every article needs a heading (h1h6) that describes its topic
  • Heading levels — maintain a logical outline; don’t skip levels inside an article
  • Landmarks — avoid wrapping the entire page in one article; use one per distinct content block
  • Labels — if multiple unnamed articles appear on a page, add aria-labelledby pointing to the article heading

🧠 How <article> Works

1

Author marks up content

Wrap standalone content in <article> with a heading, body, and optional <header>/<footer>.

Markup
2

Browser exposes semantics

The element is recognized as an article landmark. Search engines identify distinct content blocks for indexing.

Semantics
3

Content is distributable

Each article can be syndicated via RSS, shared on social media, or extracted without losing meaning.

Reuse
=

Well-structured, discoverable content

Users, search engines, and assistive technology all benefit from clearly defined, self-contained content regions.

Universal Browser Support

The <article> tag is supported in all modern browsers. Internet Explorer 9+ recognizes the element; IE 8 and below treat it as a generic block.

Baseline · Since HTML5

Works everywhere your users are

From IE 9 to the latest Chromium builds — the article element is a core HTML5 semantic tag with near-universal support.

100% Modern browser support
Google Chrome All versions · Desktop & Mobile
Full support
Mozilla Firefox All versions · Desktop & Mobile
Full support
Apple Safari All versions · macOS & iOS
Full support
Microsoft Edge All versions · Chromium & Legacy
Full support
Internet Explorer IE 9+ · Legacy environments
Full support
Opera All modern versions
Full support
<article> tag 100% supported

Bottom line: Ship semantic article markup with confidence. Use one <article> per standalone content block in every production environment today.

Conclusion

The <article> tag empowers you to structure content meaningfully—enhancing user experience, accessibility, and SEO. Use it for blog posts, news stories, and any block that stands on its own.

Pair it with <header>, <time>, and <footer> for rich metadata, and reserve <section> for thematic groupings that are not independently distributable.

💡 Best Practices

✅ Do

  • Use <article> for content that is complete and could stand alone
  • Include a descriptive heading in every article
  • Wrap each blog post or news story in its own <article>
  • Use <time datetime> for machine-readable publication dates
  • Nest articles for comments or related user-generated content

❌ Don’t

  • Use <article> for sidebars, footers, or site navigation
  • Wrap an entire multi-topic page in a single article
  • Skip headings—every article needs a title for accessibility
  • Confuse <article> with <section> for non-standalone groupings
  • Rely on <div> when semantic meaning matters for SEO

Key Takeaways

Knowledge Unlocked

Six truths every developer should know about <article>

Bookmark these before you ship — they’ll make every content block clearer and more discoverable.

6
Core concepts
⚖️ 02

article vs section

Use article for syndicatable blocks; section for thematic groups within a page.

Semantics
🛠 03

Global Attributes Only

No tag-specific attributes—use class, id, and lang for customization.

Reference
🔁 04

Nested Articles

Embed comments and related items inside a parent article when they belong to that content.

Pattern
05

Article Landmark

Creates an accessible region for screen readers. Every article needs a descriptive heading.

A11y
🌐 06

Universal Support

Supported in all modern browsers including IE 9+. No polyfills required.

Compatibility

❓ Frequently Asked Questions

The <article> element represents a self-contained piece of content—blog posts, news stories, forum posts, or product cards that could be syndicated or shared independently.
<article> is for standalone content (syndication test). <section> groups related content within a page that is not necessarily independent.
Yes. Nested <article> elements represent content related to the outer article, such as user comments on a blog post.
No. Use global attributes like class, id, lang, and style.
Yes, when each post is a distinct standalone piece. Wrap the title, body, and metadata in one <article> per post.
Yes. Use <header> for the article title and metadata, and <footer> for author info or tags—scoped to the article, not the whole page.

Build a Blog Layout

Open the Try It editor and practice wrapping posts in article elements.

Try Blog Posts →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful