HTML Basic
HTML Reference
- HTML Tags
- <!--...-->
- <!DOCTYPE>
- <a>
- <abbr>
- <address>
- <area>
- <article>
- <aside>
- <audio>
- <b>
- <base>
- <bdi>
- <bdo>
- <blockquote>
- <body>
- <br>
- <button>
- <canvas>
- <caption>
- <cite>
- <code>
- <col>
- <colgroup>
- <data>
- <datalist>
- <dd>
- <del>
- <details>
- <dfn>
- <dialog>
- <div>
- <dl>
- <dt>
- <em>
- <embed>
- <fieldset>
- <figcaption>
- <figure>
- <footer>
- <form>
- <h1> to <h6>
- <head>
- <header>
- <hgroup>
- <hr>
- <html>
- <i>
- <iframe>
- <img>
- <input>
- <ins>
- <kbd>
- <label>
- <legend>
- <li>
- <link>
- <main>
- <map>
- <mark>
- <menu>
- <meta>
- <meter>
- <nav>
- <noscript>
- <object>
- <ol>
- <optgroup>
- <option>
- <output>
- <p>
- <param>
- <picture>
- <pre>
- <progress>
- <q>
- <rp>
- <rt>
- <ruby>
- <s>
- <samp>
- <script>
- <search>
- <section>
- <select>
- <small>
- <source>
- <span>
- <strong>
- <style>
- <sub>
- <summary>
- <sup>
- <svg>
- <table>
- <tbody>
- <td>
- <template>
- <textarea>
- <tfoot>
- <th>
- <thead>
- <time>
- <title>
- <tr>
- <track>
- <u>
- <ul>
- <var>
- <video>
- <wbr>
- HTML Deprecated Tags
- HTML Events
- HTML Global Attributes
- HTML Status Code
- HTML Language Code
- HTML Country Code
- HTML Charset
- MIME Types
HTML article Tag
Photo Credit to CodeToFun
🙋 Introduction
In the ever-evolving landscape of web development, understanding and utilizing HTML tags is crucial.
This guide will delve into the <article>
tag, shedding light on its purpose and how to effectively implement it in your HTML documents.
🤔 What is <article> Tag?
The <article>
tag is a semantic HTML5 element that is used to define a self-contained piece of content. It is designed for content that can be distributed and reused independently, such as articles, blog posts, or forum posts.
💡 Syntax
To use the <article>
tag, wrap the content you want to consider as a standalone article within the opening <article>
and closing </article>
tags.
<article>
<!-- Your article content goes here -->
<h2>Article Title</h2>
<p>Introduction to your article...</p>
<!-- Additional content -->
</article>
🧰 Attributes
The <article>
tag supports global attributes like class and id, enabling you to apply styles or target specific articles with CSS or JavaScript.
<article class="featured-article" id="main-article">
<!-- Your article content goes here -->
</article>
📚 Common Use Cases
Blog Posts:
One of the primary use cases for the
<article>
tag is in structuring blog posts. Each blog post can be encapsulated within its own<article>
element, promoting clear organization and aiding in search engine optimization.blog-posts.htmlCopied<article> <h2>Blog Post Title</h2> <p>Content of your blog post...</p> </article>
News Articles:
When displaying news articles on a website, the
<article>
tag is invaluable for encapsulating each news piece, making it easily shareable and distinguishable.news-articles.htmlCopied<article> <h2>Breaking News Title</h2> <p>Details of the breaking news...</p> </article>
🖥️ Browser Support
Understanding the compatibility of the <article>
tag across different browsers is essential for delivering a consistent user experience. Here's an overview of its support:
- Google Chrome: Fully supported.
- Mozilla Firefox: Fully supported.
- Microsoft Edge: Fully supported.
- Safari: Fully supported.
- Opera: Fully supported.
- Internet Explorer: Partial support (some versions may have limitations).
Ensure you test your code in various browsers to guarantee a seamless experience for your audience.
🏆 Best Practices
- Use the
<article>
tag for content that is complete, independent, and can stand alone. - Avoid using
<article>
for content that is part of a larger work, like a sidebar or footer. - Ensure your article has a meaningful heading (<h1>, <h2>, etc.) for accessibility and SEO.
🎉 Conclusion
Embracing the <article>
tag empowers web developers to structure content in a meaningful way, enhancing both user experience and search engine optimization. Incorporate this tag judiciously into your HTML documents to create well-organized and easily digestible content.
👨💻 Join our Community:
Author
For over eight years, I worked as a full-stack web developer. Now, I have chosen my profession as a full-time blogger at codetofun.com.
Buy me a coffee to make codetofun.com free for everyone.
Buy me a Coffee
If you have any doubts regarding this article (HTML article Tag), please comment here. I will help you immediately.