问题
I'm making a Tumblr theme (hold your criticism) and I'd like to use some semantic tags (since this seems to be something most themes don't have.) The way these blogs are styled is a main page full of posts that may be truncated, and may not be. You can then click a link and get a permalink to that post, or the full post if it's truncated.
I want to use <article>
for these posts on the main page, but I don't know if it's okay to put a truncated post in an <article>
tag. I'd guess it'd be okay since the RSS feed could supply a link to the full article, but then would the full article also use <article>
tags? Is <section>
more applicable, even though some posts are perfectly fit for syndication?
回答1:
From the documentation, article (bold is from me):
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.
So article
represents not only complete, but self-contained composition in document too, as bolded above, that means, truncated posts fits article
element too.
section on the other hand (bold is from me):
The section element represents a generic section of a document or application. A section, in this context, is a thematic grouping of content. The theme of each section should be identified, typically by including a heading (h1-h6 element) as a child of the section element.
So section
should not include posts or their fragments directly.
来源:https://stackoverflow.com/questions/23692612/is-article-okay-for-truncated-posts