article
元素的规范说:
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.
因此,如果我正在构建一个网站,在该网站的主页中,我有可点击的卡片并将您引导至文章页面,那么在语义上,这张卡片是
section
还是 article
元素会更好?
最佳答案
将 article
元素用于发布预告片可能是合适的。这取决于您显示的内容。例如:
article
元素。 article
元素,因为每个预告片都将成为文档大纲中的一个条目(因为 article
是一个分节内容元素),但没有太多意义如果它不包含任何附加内容,则为大纲条目。 如果您决定使用
article
(并且只有那时!),您可以使用 bookmark
link type 作为指向完整文章页面的链接。这可能暗示您的 article
不是“完整的东西”。如果您决定不使用
article
,请不要使用 section
。如果在 article
和 section
之间进行选择,则 article
是预告片的正确选择。但是如果 article
不合适,你不应该使用另一个分节内容元素,而是使用类似 p
和/或 ul
的东西(并且没有标题元素)。
关于html - HTML5 中卡片/卡片容器的元素?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43953026/