The HTML 'article' Tag
The HTML article
tag is a useful element.
Benefits for you: With the article
tag, you can tell browsers, search engines, and other automated content processors which content of your page constitutes the main article or primary content.
Benefits for browsers: When browsers try to identify the main article content of your web page, the article
tag can guide them.
The focus of this article is on using the article
tag to help browsers determine which content on the page is your main content — specifically for browsers that offer a feature commonly referred to as "reader view". Reader view is a feature many browsers offer that allows users to view your web page without navigation, ads, and other elements separate from the article.
When a site visitor taps the reader view icon, some browsers provide options to change the appearance of the page or even to have the article read aloud.
Not all web pages can be rendered in a reader view. The way the page is constructed can prevent the browser from determining what is and what is not the main content. For those pages, the browser's reader view icon would be missing or grayed out.
Using the article
tag is fairly simple:
<article> Your article. </article>
You may have more than one set of article
tags, such as:
<article> Part of your article. </article> Other stuff. <article> More of your article. </article>
In general, browsers remove potentially distracting elements from reader-view content. This can include buttons, ads, videos, and background images.
It is important to note that not all browsers provide a reader-view function. I am on a Mac and my Safari, Firefox, Tor, and Vivaldi all provide a reader view from the address bar. Chrome provides a version of the functionality at their "More Tools | Reading Mode" menu item. I was unable to find it at all on the DuckDuckGo browser.
Consider using the article
tag. It is likely to be beneficial for your web pages.
At the very least, take a moment to review your web pages to see how users will see your content when they use their reader view.
(This content first appeared in Possibilities newsletter.)
Will Bontrager