w3resource

HTML5 Article Element Tutorial

Article

In this page, we have discussed Description, Usage, Attributes, Example, Result, and Compatibility of HTML5 article element.

html5 atricle

The HTML Article element (<article>) represents independent (w.r.t a web document, page, site or application) content, for example a forum post, a magazine or newspaper article, a blog entry, a user-submitted comment, an interactive widget or gadget.

The HTML Article Element contains either actual content or contains several different section elements or one or more article elements within it.

If it contains article element within it, the content of the inner articles supposed to be related to the outer article's content.

If it is necessary to provide author information of the article, that can be done using <address>.

Using pubdate attribute of time element, date and time of publication of an article can be described.

Usage

<article>
<h1>Tutorial of HTML5 article element</h1>
<p>HTML5 article element represents independent item like a blog entry in an web document.</p>
</article>

Whether start and end tag are required

Both start and end tag are required.

What an article element can contain

Text or embedded content.

Which elements can contain article element

Any element except the elements which can contain text or embedded content.

Attributes

article element does not have any other attributes than the global attributes (accesskey, class, contenteditable, contextmenu, dir, draggable, dropzone, hidden, id, lang, spellcheck, style. tabindex, title), common to all elements.

Example

<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset=utf-8>
<title>HTML5 article example</title>
</head>
<body>
<article>
<h1>Tutorial of HTML5 article element</h1>
<p>HTML5 article element represents independent item like a blog entry in an web document.</p>
</article>
</body>
</html>

Result

html5-article-example

Browser Compatibility

We have successfully tested the above example with following browser versions.

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support 12.0.742.122 5.0 8.0 11.50 4.0

Previous: HTML5 doctype
Next: HTML5 : Aside Element Tutorial

Test your Programming skills with w3resource's quiz.



Follow us on Facebook and Twitter for latest update.