HTML <article> Tag

Beginner
5 min read
Updated: Oct 2026
4 examples
Live preview

Definition and Usage

The <article> element represents a self-contained composition that is meant to be independently distributable or reusable — a blog post, news story, forum post, product card, widget, or comment.

Give each article a clear heading. Add <header>, <footer>, and <time> when you need title metadata or a publication date. Prefer <section> when the block is only a thematic group inside a larger page.

Baseline · Widely available.

Not deprecated. Sectioning content support has been stable across browsers since about July 2015.

HTML Syntax

syntax.html
<article> …heading and content…</article>

Both start and end tags are required. Flow content is allowed inside. Do not place an <article> inside an <address>.

Attributes

<article> has no element-specific attributes. Use the global attributes you need most often:

AttributeDescriptionTry it
idUnique identifier for linking or scripting (e.g. deep links to a post)Try it
classHooks for CSS or shared post stylesTry it
langLanguage of this article when it differs from the pageGlobal attr
titleAdvisory tooltip text (use sparingly; prefer visible headings)Global attr

Global Attributes

The <article> tag also supports the Global Attributes in HTML.

Live Preview

Switch common article patterns and see the structure update live.

Real <article> markup. Apply a pattern to compare structures.

Preview

Learning Semantic HTML

Published

An article is content that can stand on its own.

Blog post — one self-contained article with a heading and time.

HTML Examples

Short, copy-ready snippets. Use Try It Yourself for a live editor.

Example 1 — Basic Article

A self-contained post with a heading and body text.

HTML
<article>
  <h2>Why Learn HTML First?</h2>
  <p>
    HTML defines the structure and meaning of web content.
    Master it before styling and scripting.
  </p>
</article>
Try It Yourself

How It Works

  1. Open <article>. Marks one standalone piece of content.
  2. Add a heading so readers and assistive tech can identify it.
  3. Put the body (paragraphs, lists, media) inside the same article.
  4. Close the tag. Both start and end tags are required.

Example 2 — Header, time, and Footer

Add publication metadata and author contact around the body.

HTML
<article>
  <header>
    <h2>Getting Started with Semantic HTML</h2>
    <p>Published <time datetime="2026-10-28">October 28, 2026</time></p>
  </header>
  <p>
    Elements like article, header, and footer help browsers
    and search engines understand your content.
  </p>
  <footer>
    <address>
      Written by <a href="mailto:[email protected]">Mari Selvan</a>
    </address>
  </footer>
</article>
Try It Yourself

How It Works

  1. <header> groups the title and intro metadata for this article.
  2. <time datetime="…"> exposes a machine-readable date.
  3. Body paragraphs stay between header and footer.
  4. <address> in the footer is for contact for this article (not nested articles).

Example 3 — Nested Articles (Comments)

Inner articles represent related items, such as comments on a post.

HTML
<article>
  <h2>Favorite HTML Tips</h2>
  <p>Share one tip that helped you learn HTML.</p>

  <section>
    <h3>Comments</h3>
    <article>
      <h4>Use real headings</h4>
      <p>Skip fake bold text — use h2–h6.</p>
      <footer>
        <p>Posted <time datetime="2026-10-27">Oct 27</time> by Alex</p>
      </footer>
    </article>
    <article>
      <h4>Validate your markup</h4>
      <p>Catch nesting mistakes early.</p>
      <footer>
        <p>Posted <time datetime="2026-10-28">Oct 28</time> by Sam</p>
      </footer>
    </article>
  </section>
</article>
Try It Yourself

How It Works

  1. Outer <article> is the main post.
  2. Group comments in a <section> with its own heading.
  3. Each comment is its own <article> — related to, but separate from, the post.
  4. Keep heading levels orderly (h2 → h3 → h4).

Example 4 — Multiple Articles on One Page

On a blog index, wrap each independent post in its own <article>.

HTML
<main>
  <h1>Recent Posts</h1>

  <article>
    <h2>First Blog Post</h2>
    <p>Intro to the first post.</p>
    <p><a href="/blog/first">Read more</a></p>
  </article>

  <article>
    <h2>Second Blog Post</h2>
    <p>Intro to the second post.</p>
    <p><a href="/blog/second">Read more</a></p>
  </article>
</main>
Try It Yourself

How It Works

  1. One post → one <article>. Do not wrap the whole feed in a single article.
  2. Page title can sit in <main> (or a page header) outside the posts.
  3. Each card stays self-contained with its own heading and summary.
  4. Links point to the full post URL.

Edge Cases & Pitfalls

Most mistakes mix up article with generic wrappers or skip headings.

semantics

Not every box is an article

If the block cannot stand alone (site chrome, a pure layout group), use <div> or <section> instead.

a11y

Identify with a heading

Landmark navigation works better when each article has a visible heading child.

nesting

Nest only when related

Inner articles should be about the outer one (comments, chapters). Unrelated posts stay siblings.

address

Never inside <address>

The HTML spec forbids <article> as a descendant of <address>.

vs section

Syndication test

Ask: “Could this be an RSS/Atom item?” If yes → article. If it is only a page chapter → section.

Browser Support

The <article> element is core HTML5 sectioning content in every major browser. It is not a Node.js, Deno, or Bun API.

✓ Baseline · Widely available

<article>

Widely available since about July 2015. Chrome, Firefox, Safari, Edge, and Opera all support article as a sectioning element with an implicit ARIA role of article.

98% Global support (approx.)
Google Chrome All
Full support
Mozilla Firefox All
Full support
Apple Safari All
Full support
Microsoft Edge All
Full support
Opera All
Full support
Samsung Internet All
Full support
Internet Explorer 9+
Supported
<article> Widely supported

Bottom line: Safe to use everywhere for semantic self-contained content. Pair with headings for the best accessibility.

Key Takeaways

  • Role: <article> marks content that can stand alone or be reused.
  • Heading: identify each article with an appropriate h* child.
  • Nesting: inner articles are related items (often comments).
  • vs section: standalone/reusable → article; thematic group → section.

One line: if it could be its own syndicated item, wrap it in <article>.

Default CSS Settings

Browsers treat article as a block sectioning element. A typical user-agent idea:

default.css
article {
  display: block;
}

Visual cards, borders, and spacing come from your CSS — semantics stay in the HTML.

Frequently Asked Questions

The article element marks a self-contained composition that could stand alone or be reused (syndication) — for example a blog post, news story, forum post, product card, or user comment.
Use article when the block could be republished on its own. Use section to group related content that is part of a larger page but not necessarily standalone.
Yes. An inner article represents content related to the outer one — commonly comments inside a blog post.
No. article only supports the Global Attributes in HTML (such as id, class, and lang).
Yes in practice. Identify each article with a heading (h2–h6 as appropriate) so people and assistive tech can find the entry.
No. An article must not be a descendant of an address element.

Next: aside

Mark complementary content such as sidebars and pull quotes.

aside tutorial →

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.

11 people found this page helpful