Skip to main content

HTML Tags

HTML <article> Tag

Written by Updated HTML <article> Tag exercises

The article tag wraps content that would still make sense on its own, taken out of the page: a blog post, a news story, a product card, a comment. If you could post it in an RSS feed or share it alone, it is an article.

That "makes sense alone" test is the difference from the section tag, which is one part of something bigger. Both are semantic layout tags.

Syntax

html

<article>
  <!-- Self-contained content like blog post or news article -->
</article>

It has no attributes of its own, only the global ones such as id, class, style and title.

Example

html

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Article Tag Example</title>
</head>
<body>
  <h1>Blog Page</h1>

  <article style="border: 1px solid #ccc; padding: 15px; margin-bottom: 20px;">
    <h2>Understanding HTML Semantic Tags</h2>
    <p>Semantic tags like &lt;article&gt;, &lt;section&gt;, and &lt;header&gt; provide meaning and structure to web pages.</p>
    <p>They help both <strong>users</strong> and <strong>search engines</strong> understand the content better.</p>
  </article>

  <article style="border: 1px solid #ccc; padding: 15px;">
    <h2>Benefits of Using Semantic HTML</h2>
    <p>Semantic HTML improves accessibility, SEO, and maintainability of websites. It makes content easier to read for humans and machines alike.</p>
  </article>
</body>
</html>

Two blog-style posts appear as separate bordered boxes, each with its own heading and text. Each one could be moved to another page without losing its meaning.

What goes inside an article

A typical blog post

html

<article>
  <header>
    <h2>How to bake bread</h2>
    <p>By Asha · <time datetime="2025-03-03">3 March 2025</time></p>
  </header>
  <p>Start with good flour...</p>
  <footer>Tags: baking, bread</footer>
</article>

An article can have its own header and footer, and its own time for the publication date.

Nesting articles

Comments on a blog post are articles inside the post's article: each one stands on its own, but belongs to the post. A page listing many products can have one <article> per product card.

Browser Support

Chrome
Edge
Firefox
Safari
Opera
IE9+
YesYesYesYesYesYes

Good to know

  • Give every article a heading, so it is clear what it is about.
  • Do not wrap your whole page in <article>. The page's unique content belongs in <main>; articles go inside it.

HTML <article> Tag exercises

Wrap a post

Make an article with the level 2 heading Monsoon and the paragraph It has begun.

Result

Check your answer to see it here.