Is there an HTML5 tag to signify an article preview?

不羁的心 提交于 2019-12-12 13:25:05

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!