Article represents a self-contained piece of content that could make sense on its own, such as a news item, post, or review.
What You Need to Know
An article can have its own header and footer. If the content is only a subsection of something larger, section may be more appropriate.
The goal is not to collect as many tags as possible. Pick the element that best describes what the content really is.
Example: See It in Action
This example keeps the idea small. Copy it carefully, then follow the explanation instead of guessing what the browser will do.
This is a short HTML fragment. To try it as a webpage, put it inside the body element of a complete HTML document.
<article>
<h2>Our Latest Adventure</h2>
<p>We explored the nature reserve.</p>
<footer>
<p>Posted by Maya</p>
</footer>
</article>
Let’s Understand the Example
- Article marks a piece that could make sense on its own, such as a news post or recipe.
- An h2 starts a major section beneath the page topic.
- A p groups a paragraph of related text. Start another paragraph for a new thought.
You should see a readable heading and its related content. The heading level tells readers how the ideas fit together, not merely how large the letters look.
What Should You See?
The page should display “Our Latest Adventure” as a heading, followed by its related content. Change the heading text and refresh the browser to see the result.
Read only the headings, from top to bottom. Do they tell a sensible story? If not, move sections or choose levels that match the content.
Try It Yourself
- Add a second independent article preview with its own heading.
- Save your changes, open or refresh the page, and compare the result with the original example.
- Tell a friend what your change did. If you are not sure, undo it, refresh the page, and compare.
Common Beginner Mistakes
- Wrapping a site-wide navigation bar in article just because it is important.
- Avoid picking tags just for their default bold, italic or spaced appearance. Use CSS for presentation.
Key Takeaways
- Article represents a self-contained piece of content that could make sense on its own, such as a news item, post, or review.
- Article marks a piece that could make sense on its own, such as a news post or recipe.
- An article can have its own header and footer. If the content is only a subsection of something larger, section may be more appropriate.