问题
The description for an article element read:
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.
However, I'm interested in showing a preview of some content that will be wrapped in an article element. It isn't the article itself, but is a link to the article and contains some of the content. Is there a semantic way of expressing this in HTML5, or would divs be appropriate?
回答1:
There is no HTML5 tag specifically for preview excerpts.
Arguably, a summary of an article is a self-contained, potentially-reusable/syndicate-able bit of content, so you’d probably be fine using <article> for it.
Otherwise, <div>
is always fine, although you might consider <section>
or a list depending on the context.
To mark up the actual preview text, you could use <blockquote>, as you’re quoting the article.
回答2:
nav
may be come handy, but it risks becoming overkill, as it creates a section in the outline. One may also consider using figure
, especially if the excerpt also has a thumbnail.
来源:https://stackoverflow.com/questions/7969153/is-there-an-html5-tag-to-signify-an-article-preview