0

I'm making a view which will show a list of blog posts, with small excerpts of each. Is the correct semantic element to use?

Duncan Felix
  • 43
  • 1
  • 6
  • http://stackoverflow.com/questions/2895214/what-is-the-semantically-correct-way-to-use-the-article-tag-in-html-5-with – Abhitalks May 19 '14 at 15:04
  • possible duplicate of [Is
    okay for truncated posts?](http://stackoverflow.com/questions/23692612/is-article-okay-for-truncated-posts)
    – unor May 19 '14 at 18:30

3 Answers3

1

I would use it like this for each adding a header and a footer too

<article>
<header>
<h1>Apple</h1>
<p>Published: <time>2009-10-09</time></p>
</header>
<p>The <b>apple</b> is the pomaceous fruit of the apple tree...</p>
 <footer>
<p><small>Creative Commons Attribution-ShareAlike License</small></p>
</footer>
</article>
nolawi
  • 4,439
  • 6
  • 22
  • 45
1

For small excerpts, both article and section are OK.

Quoted from html spec:

The article element represents a complete, or self-contained, composition in a document, page, application, or site and that is, in principle, 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.

Note that:

Authors are encouraged to use the article element instead of the section element when it would make sense to syndicate the contents of the element.

Anderson
  • 2,496
  • 1
  • 27
  • 41
0

The key point here is that the content has to make sense independent of its context, i.e. when all the surrounding content is stripped away.

Soruce

An example is:

<article>
    <h1>Header</h1>
    <p>Text</p>
</article>

So each blog-post preview can be an article element.

ohboy21
  • 4,259
  • 8
  • 38
  • 66