XHTML lists?
hi there.. i'm trying to nest three unordered lists into one ordered list. In my opinion the coding should be done the following way: <ol> <li>..........</li> <ul> <li>.............</li> <li>.............</li> <li>.............</li> </ul> <li>..........</li> <ul> <li>.............</li> <li>.............</li> <li>.............</li> </ul> <li>..........</li> <ul> <li>.............</li> <li>.............</li> <li>.............</li> </ul> </ol> Please tell me if i'm correct...if not how it should be?
Public Comments
- Looks good to me! No problem with nesting lists.
- That's incorrect. Lists (ordered and unordered) will only accept a List Item as their child element. If you want to nest an unordered list inside an ordered list, the former has to be a child of a list item: <ol> <li>An ordered List Item</li> <li>An ordered List Item <ul> <li>An unordered List Item</li> </ul> </li> </ol> Following the same principle, that nested unordered list can have another unordered list nested in it provided that the second list is a child element of the first one's list item. So this is wrong: <ol> <li>A list item</li> <ul> <li>Something</li> </ul> <li>Another item</li> </ol>
- Remove <li></li> from the <ol> tag. This way you are creating 3 ordered lists and 3 un-ordered lists. Here is the code <ol> <li>..........</li> <ul type="square"> <li>.............</li> <li>.............</li> <li>.............</li> </ul> <ul> <ul> <li>.............</li> <li>.............</li> <li>.............</li> </ul> </ul> <ul> <ul> <ul> <li>.............</li> <li>.............</li> <li>.............</li> </ul> </ul> </ul> </ol> For tutorials log on to http://gateway2internet.com
- Here is the valild format for you to do so, <ol> <li>.......... <ul> <li>.............</li> <li>.............</li> <li>.............</li> </ul> </li> <li>.......... <ul> <li>.............</li> <li>.............</li> <li>.............</li> </ul> </li> <li>.......... <ul> <li>.............</li> <li>.............</li> <li>.............</li> </ul> </li> </ol>
Powered by Yahoo! Answers