Click to See Complete Forum and Search --> : UL within OL


tracknut
11-09-2007, 10:38 AM
I've got an odd formatting situation where I'd like to have an ordered list, and within one of the items I'd like to have an unordered list. So the final result would look like:

1. Aston Martin
2. BMW
- 330
- 540
3. Ferrari
4. Volkswagen

According to strict doctypes, this isn't allowed. So do I need to fake it, with literal numbers or dots on one of the lists? If so, I'd like to be able to wrap the text such that it works right (indents) under the number or dot.

Hopefully that makes sense :)

Thanks
Dave

TJ111
11-09-2007, 10:41 AM
It's easy, just place the <ul> inside of an open <li> element. Like this:

<ol>
<li>Item</li>
<li>Item
<ul>
<li>Sub-Item</li>
<li>Sub-item</li>
</ul>
</li>
<li>Item</li>
</ol>

tracknut
11-09-2007, 10:58 AM
Ah, beautiful, thanks. I had one of the tags in the wrong place. :)

Dave