商店商品是什么类型的 HTML5 element/tag?
What type of HTML5 element/tag would a shop item be?
假设您必须编写一个 html5 只有语义的网站,现在您想要创建一些代表可购买商品的商品。
哪种类型的标签最合适?它不是 <section>
,也不是 <object>
。 Div 绝对是错误的,因为只需要 html5 语义。
你应该使用 <article>
.
根据 HTML standard:
The article
element represents a complete, or self-contained, composition in a document, page, application, or site and that is, in principle, 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.
此描述非常适用于带有产品的卡片。
假设您必须编写一个 html5 只有语义的网站,现在您想要创建一些代表可购买商品的商品。
哪种类型的标签最合适?它不是 <section>
,也不是 <object>
。 Div 绝对是错误的,因为只需要 html5 语义。
你应该使用 <article>
.
根据 HTML standard:
The
article
element represents a complete, or self-contained, composition in a document, page, application, or site and that is, in principle, 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.
此描述非常适用于带有产品的卡片。