为什么我们总是使用< ul>让导航为什么不< ol>? [英] Why we always use <ul> to make Navigation why not <ol>?

查看:126
本文介绍了为什么我们总是使用< ul>让导航为什么不< ol>?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么我们总是使用< ul> 来导航为什么不要< ol>

解决方案

两者之间没有太大的实际差异。



使用< ol> 表明重要的是列表保持相同的顺序。对于网络上的大多数导航,导航项的顺序无关紧要。



流程中的导航例外,例如。如果您要通过3步购买流程吸引用户,并让他们导航到任何步骤。有序列表在那里是适当的,因为步骤是一个接一个地,例如

 < ol> 
< li>付款详情< / li>
< li>送货地址< / li>
< li>摘要< / li>
< / ol>请注意,在HTML5中,你可以并且应该包装任何主要的导航块,无论它是否使用了<$ c

< ul>
< ol> 元素/ org / html5 / spec-author-view / the-nav-element.html#the-nav- element =nofollow noreferrer> < nav>


Why do we always use <ul> to make navigation why not <ol>? While we can use both technically.

解决方案

There isn’t much practical difference between the two.

Using <ol> suggests that it’s important the list remain in the same order. For most navigation on the web, the order of the navigation items doesn’t matter.

An exception would be navigation within a process, e.g. if you’re taking the user through a 3-step purchase process, and are giving them navigation to move to any step. An ordered list would be appropriate there, as the steps come one after the other, e.g.

<ol>
<li>Payment details</li>
<li>Delivery address</li>
<li>Summary</li>
</ol>

Note that in HTML5, you can and should wrap any major navigation block, whether it uses <ul>, <ol> or something else, in the <nav> element.

这篇关于为什么我们总是使用&lt; ul&gt;让导航为什么不&lt; ol&gt;?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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