简体   繁体   English

如何在无序列表项中编码嵌套的有序列表?

[英]How to code a nested ordered list within an unordered list item?

I want to nest an ordered list within a single unordered list item, such that the ordered list splits up the text of the list item. 我想将一个有序列表嵌套在一个无序列表项中,以便有序列表将列表项的文本分割开。 For example: 例如:

• An unordered point, text text text... •无序点,文本文本文本...
1. First ordered list item 1.第一个订购清单项目
2. Second ordered list item 2.第二订购清单项目
...continued text from same unordered point. ...从同一无序点继续的文本。
• Another unordered point •另一个无序点

I'm wondering what's the proper way to code this? 我想知道编码的正确方法是什么? I've tried: 我试过了:

<ul>
  <li>An unordered point, text text text...
  <ol>
    <li>First ordered list item</li>
    <li>Second ordered list item</li>
  </ol>
  ...continued text from same unordered point.</li>
  <li>Another unordered point</li>
</ul>

but not sure if that's the correct way to mark it up. 但不确定这是否是标记的正确方法。 Also, when I testing this in Chrome and FF, the line spacing before and after the nested ordered list does not balance out; 另外,当我在Chrome和FF中测试此功能时,嵌套有序列表前后的行距无法平衡。 I'm getting: 我越来越:

• An unordered point, text text text... •无序点,文本文本文本...
1. First ordered list item 1.第一个订购清单项目
2. Second ordered list item 2.第二订购清单项目

...continued text from same unordered point. ...从同一无序点继续的文本。
• Another unordered point •另一个无序点

这是正确的方法,但是您将需要使用CSS来删除嵌套列表上的边距,这将解决您的间距问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM