开发者

Which one is better to use for list item?

开发者 https://www.devze.com 2023-02-19 10:03 出处:网络
Suppose I have ten list item, in that case I can use both div and li to display them one aft开发者_StackOverflow中文版er another. But my concern is which one will be better approach in page loading pe

Suppose I have ten list item, in that case I can use both div and li to display them one aft开发者_StackOverflow中文版er another. But my concern is which one will be better approach in page loading perspective?


Semantically, if you have items in a list <li> is how they should be marked up.


use <li>, they are semantically more correct. furthermore, if you use <ul> or <ol> (or <dl>) you can only have <li> as child elements


I would use list items, as they're intended for grouping various items into... well, lists. If you don't actually want it to look like an ordered (numbered) <ol> or unordered (bulleted) <ul> list, then you can always use CSS to style the graphics out.

0

精彩评论

暂无评论...
验证码 换一张
取 消