What is the purpose of HTML5's Article tag?

 Posted by Niladri.Biswas on 9/11/2012 | Category: HTML 5 Interview questions | Views: 2134 | Points: 40
Answer:

It is used to semantically mark the main content section or sections of a page.

An HTML5 page may contain multiple individual parts of main content. For instance, a blog website may contain a page with multiple blog posts in. In that case, each blog post would be enclosed in its own article element.

e.g.

<html>

<body>
<header>
Company Logo
<nav>
<a href="MainPage1.html">Page 1</a>
<a href="Main2.html">Page 2</a>
</nav>
</header>

<nav>
<a href="Subpage1.html">SubPage 1</a>
<a href="Subpage2.html">SubPage 2</a>
</nav>

<article>
<p>Main content section 1</p>
</article>

<article>
<p>Main content section 2</p>
</article>

<footer></footer>

</body>
</html>


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response