1

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
2. Second ordered list item
...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; I'm getting:

• An unordered point, text text text...
1. First ordered list item
2. Second ordered list item

...continued text from same unordered point.
• Another unordered point

2
  • 1
    I see no problem with that. jsfiddle.net/YbntS I'm not sure what you mean by "not balanced out". Commented Jan 5, 2012 at 18:48
  • @JamesMontagne: I mean there's more line spacing beneath the ordered list than above it. I guess the problem will be corrected with CSS, as per Matt K's suggestion. But it's interesting that it renders without the spacing problem in JSFiddle. Commented Jan 5, 2012 at 18:54

1 Answer 1

5

This is the correct way, however you will need to play with the css to remove the margins on your nested list, which will fix your spacing problem.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.