The <article> element denotes content that is standalone and self-contained.
An article should be comprehensible independently and capable of distribution apart from the surrounding website.
Instances where the <article> element is suitable include:
Example
Three pieces of content, each self-contained and independent:
<article> <h2>Google Chrome</h2> <p>Google Chrome is a web browser developed by Google, released in 2008. Chrome is the world’s most popular web browser today!</p> </article> <article> <h2>Mozilla Firefox</h2> <p>Mozilla Firefox is an open-source web browser developed by Mozilla. Firefox has been the second most popular web browser since January, 2018.</p> </article> <article> <h2>Microsoft Edge</h2> <p>Microsoft Edge is a web browser developed by Microsoft, released in 2015. Microsoft Edge replaced Internet Explorer.</p> </article> |
Example 2
Utilize CSS for styling the <article> element:
<html> <head> <style> .all-browsers { margin: 0; padding: 5px; background-color: lightgray; } .all-browsers > h1, .browser { .browser { .browser > h2, p { </head> <body> <article class=”all-browsers”> <h1>Most Popular Browsers</h1> <article class=”browser”> <h2>Google Chrome</h2> <p>Google Chrome is a web browser developed by Google, released in 2008. Chrome is the world’s most popular web browser today!</p> </article> <article class=”browser”> <h2>Mozilla Firefox</h2> <p>Mozilla Firefox is an open-source web browser developed by Mozilla. Firefox has been the second most popular web browser since January, 2018.</p> </article> <article class=”browser”> <h2>Microsoft Edge</h2> <p>Microsoft Edge is a web browser developed by Microsoft, released in 2015. Microsoft Edge replaced Internet Explorer.</p> </article> </article> </body> </html> |