HTML 嵌套有序列表
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12574052/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
HTML nested ordered list
提问by jhchen
Possible Duplicate:
Proper way to make HTML nested list?
可能的重复:
制作 HTML 嵌套列表的正确方法?
I'd like to produce the following in HTML:
我想在 HTML 中生成以下内容:
1. One
2. Two
1. Inner One
2. Inner Two
3. Three
One way is
一种方法是
<ol>
<li>One</li>
<li>Two</li>
<ol>
<li>Inner One</li>
<li>inner Two</li>
</ol>
<li>Three</li>
</ol>
But according to Proper way to make HTML nested list?this is not the proper way to do this. The "proper" way produces this:
但是根据正确的方法来制作 HTML 嵌套列表?这不是执行此操作的正确方法。“正确”的方式产生这个:
1. One
2. Two
3.
1. Inner One
2. Inner Two
4. Three
So, is there a proper way to nest ordered lists without extra numbers appearing for the nested lists?
那么,是否有一种正确的方法来嵌套有序列表而不会出现嵌套列表的额外数字?
回答by Eric
<ol>
<li>One</li>
<li>Two
<ol>
<li>Inner One</li>
<li>inner Two</li>
</ol>
</li>
<li>Three</li>
</ol>
gives
给
- One
- Two
- Inner One
- inner Two
- Three
- 一
- 二
- 内一
- 内二
- 三
<ul>
is for *u*nordered lists.
<ul>
用于*u*无序列表。
回答by Gloomcore
I think, you are searching for this:
我想,你正在寻找这个:
<ol>
<li>One</li>
<li>Two
<ol>
<li>Inner One</li>
<li>inner Two</li>
</ol>
</li>
<li>Three</li>
</ol>
Outputs to:
输出到:
1. One
2. Two
1. Inner One
2. Inner Two
3. Three
回答by KitWat
As stated above you just need an ordered list
如上所述,您只需要一个有序列表
<ol>
<li>one</li>
<li>two</li>
<ol>
<li>inner 1</li>
<li>inner 2</li>
</ol>
<li>three</li>
</ol>