The HTML <article> tag is used to mark a self-contained, independent piece of content within a web page. It's typically used for content that can be distributed and understood on its own, such as blog posts, news articles, forum posts, or other types of content that make sense independently from the rest of the page.
HTML Article tag
Here's an example of how the <article> tag can be used in an HTML document:
<!DOCTYPE html>
<html>
<head>
<title>Sample Page</title>
</head>
<body>
<header>
<!-- Header content here including h1 heading title-->
</header>
<main>
<article>
<h2>Understanding HTML Article Tag</h2>
<p>The <article> tag in HTML is used...</p>
</article>
<article>
<h2>Benefits of Semantic HTML</h2>
<p>Semantic HTML elements, such as...</p>
</article>
</main>
<footer>
<!-- Footer content here -->
</footer>
</body>
</html>
In this example, each <article> tag encapsulates a separate piece of content. Each article can be read and understood independently of the others, which is the key characteristic of an <article> element.
Using the <article> tag enhances the semantic structure of your HTML document, indicating that the content within each <article> is a discrete unit that can stand alone. This helps search engines and assistive technologies better identify and handle the individual pieces of content, and it also improves the overall organization and readability of your page.
×