是否有 HTML5 标签来表示文章预览?
文章元素的描述如下:
article 元素表示页面的一个组件,该组件由以下部分组成 文档、页面、应用程序或站点中的独立组成部分 并且旨在可独立分发或可重复使用, 例如在联合组织中。这可以是论坛帖子、杂志或 报纸文章、博客条目、用户提交的评论、 交互式小部件或小工具,或任何其他独立项目 内容。
但是,我有兴趣显示将包含在文章元素中的一些内容的预览。它不是文章本身,而是文章的链接,包含一些内容。在 HTML5 中是否有一种语义方式来表达这一点,或者 div 是否合适?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
没有专门用于预览摘录的 HTML5 标记。
可以说,一篇文章的摘要是一个独立的、可能可重用/联合的内容,因此您可能可以使用
。
否则,
总是可以的,尽管您可能会根据上下文考虑
或列表。
要标记实际的预览文本,您可以使用
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.nav
可能会很方便,但它有可能变得矫枉过正,因为它在大纲中创建了一个部分。人们还可以考虑使用figure
,特别是当摘录也有缩略图时。nav
may be come handy, but it risks becoming overkill, as it creates a section in the outline. One may also consider usingfigure
, especially if the excerpt also has a thumbnail.