Is the article tag of HTML5 only to use in blogs? Is it only for blog articles? Is it not to use for the content section of website, which is not a blog?
Generally I use
<div id="content">
<h2> title </h2>
<p> content </p>
</div>
Should I replace div with article
<article id="content">
<h2> title </h2>
<p> content </p>
</article>
or
<div id="content">
<article>
<h2> title </h2>
<p> content </p>
</article>
</div>
From the spec:
The article element represents a component of a page that consists of a self-contained composition in a document, page, application, or site and that is intended to be independently distributable or reusable, e.g. in syndication. This could be a forum post, a magazine or newspaper article, a blog entry, a user-submitted comment, an interactive widget or gadget, or any other independent item of content.
So I guess it is quite dependant on what #content contains. If it would only contain that specific article (or stuff related to that article, like comments nested as further articles), you do not need the div.
My favourite resource about this - HTML5Doctor
There's some nice detail about the article element at html5doctor.
In a nutshell, <article> is not limited to blogs and your example
<article id="content">
<h2> title </h2>
<p> content </p>
</article>
would seem to be an ideal use of <article>.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With