我应该使用“李”还是“文章”产品上市? [英] Should I use 'li' or 'article' for products listing?

查看:95
本文介绍了我应该使用“李”还是“文章”产品上市?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做了一些研究,但没有找到合适的答案。我想知道是否最好继续使用 li 元素作为产品列表,或者切换到文章元素?



每个产品列表包含1个主要图片,名称和价格。

解决方案

<从描述产品列表(图片+名称+价格)的方式来看,它似乎不符合 article in HTML5


文章元素表示一段内容,文件或网站的独立部分;例如,杂志或报纸文章或博客文章。

问问自己:这些内容是否独立于其他内容页面内容?如果你将其置于背景之下,它本身是否有意义?如果答案是否,那么您应该考虑< article> 可能不是最合适的标签。



如果您有多个产品可以显示,则样式列表(有序或无序)似乎是最佳方法。但请查看一些实际案例:大公司如何做到这一点?:
$ b


  • Amazon,Google Shopping,TMall和Walmart使用列表( ol ul

  • AliBaba和Ebay只使用 div 没有任何列表类型的框。

  • 淘宝使用两种组合( div ul 作为名称和价格)


I made some research and didn’t find an appropriate answer. I’m wondering if it’s better to keep using li elements for a products listing or maybe switch to the article element?

Every product list contains 1 main image, name and price.

解决方案

From how you describe the product listing (image + name + price), it doesn't seem to fit the description of an article in HTML5:

The article element represents a section of content that forms an independent part of a document or site; for example, a magazine or newspaper article, or a blog entry.

Ask yourself: Will that content be independent from the rest of the page content? If you take it out of context, will it make sense by itself? If the answer is "No", then you should consider that an <article> may not be the most suitable tag.

If you have multiple products to display, a styled list (ordered or unordered) seems like the best approach for this. But check some practical cases: how do big companies do it?:

  • Amazon, Google Shopping, TMall, and Walmart use lists (ol or ul)
  • AliBaba and Ebay just uses div boxes without any type of list.
  • Taobao uses a combination of both (div for the box, and ul for the name and price)

这篇关于我应该使用“李”还是“文章”产品上市?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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