HTML5中卡/卡容器的元素? [英] Element for a card/card-container in HTML5?

查看:141
本文介绍了HTML5中卡/卡容器的元素?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

文章元素的规范说:


article 元素表示页面的一个组件,该页面由文档,页面,应用程序或站点
中的
a自包含组合组成,并且是独立的可分发的或可重复使用的,
例如在联合组织中。这可以是论坛帖子,杂志或
报纸文章,博客条目,用户提交的评论,
交互式小部件或小工具,或任何其他
内容的独立项目。 / p>

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.

所以,如果我正在建立一个网站,在其主页上,我有可点击的卡片并引导您访问该文章页面,会更好 - 在语义上 - 如果这张卡是部分文章元素?

So, if I'm building a website where, in its home page, I have cards that are clickable and leads you to the article page, would be better - in semantic - if this card would be a section or an article element?

推荐答案

使用文章元素作为帖子戏弄是合适的。这取决于您显示的内容。例如:

It can be appropriate to use the article element for post teasers. It depends on what content you show. For example:


  • :如果您显示标题,说明,图像,作者姓名,和出版日期一样,你一定要使用文章元素。

  • :如果你只显示标题,文章元素是不合理的,因为每个预告片都会成为文档大纲中的一个条目(如 article 是一个分段内容元素),但如果大纲条目不包含任何其他内容,则没有多大意义。

  • 可能:介于两者之间。标题和日期?可能不会。标题和描述?可能是的。

  • Yes: If you show the title, a description, an image, the author name, and the publication date, you should definitely use the article element.
  • No: If you only show the title, an article element wouldn’t be warranted, because each teaser would become an entry in the document outline (as article is a sectioning content element), but there isn’t much point for an outline entry if it doesn’t contain any additional content.
  • Maybe: Something inbetween. Title and date? Probably not. Title and description? Probably yes.

如果您决定使用文章(只有这样! ),您可以使用 书签链接类型指向完整文章页面的链接。这可能暗示您的文章不是完整的东西。

If you decide to use article (and only then!), you can use the bookmark link type for the link to the full article page. This can be a hint that your article isn’t the "full thing".

如果您决定不使用文章,不要使用部分。如果在文章部分之间进行选择,文章是正确的预告片的选择。但是如果 article 不合适,则不应使用其他分区内容元素,而应使用 p 和/或 ul (并且没有标题元素)。

If you decide not to use article, don’t use section. If choosing between article and section, article is the correct choice for a teaser. But if article isn’t appropriate, you shouldn’t use another sectioning content element, but something like p and/or ul (and no heading elements).

这篇关于HTML5中卡/卡容器的元素?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆