Using article Tags in HTML5

Leave a Comment

Increasingly, it is important to make all or part of the contents of a page distributable. For instance, forum discussion, blogs, reader comments, and so on could all be candidates for distribution or syndication.

In this solution, we will discuss the new HTML5 element, <article></article>, which makes accomplishing this much easier than with traditional HTML.

The purpose of this structural tag is not to serve as another way to divide your document into sections. Rather, it is used to identify the portions of the document that you want to be independent and distributable from the rest of the document.

Since the <article></article> element is independent, it can have its own sections and subdivisions. You can make any element distributable by surrounding it with the <article></article> element.

Using the example shown in Solution 1-3, you can make the cheesecake instructions distributable as follows.
<article>
<section id="mixing">
<h2>The proper way to mix ingredients</h2>
<p>When using a stand-mixer, it is important that you do not over mix the ingredients…</p>
</section>
<section id="baking">
<h2>Proper baking techniques</h2>
<p> It is important that you bake your cheesecake using a lot of moisture in the oven…</p>
</section>
</article>

Treat the <article></article> element as an independent document and not as part of a larger document. That way, when it is distributed, it will be fully readable and understandable.

0 comments:

Post a Comment