hi there,
I want to create a nested list on my webpage, a bit like this:
- item 1
- item 2
+ sub item 1
+ sub item 2
- item 3
but I can't do it! Here is the code I thought would work:
<ul>
<li>Item 1</li>
<li>Item 2
<ul>
<li>Sub Item 1</li>
<li>Sub Item 2</li>
</ul>
</li>
<li>Item 3</li>
</ul>
This doesn't give the required result. It gives:
- Item 1
Item 2
+ sub item 1
- + sub item 2
- Item 3
What am I doing wrong???
Please note: I want my code to validate, that's why I've got the closing tags. I can achieve what I need by removing the closing tags, but this isn't valid, right?
Thanks,
Calum
I want to create a nested list on my webpage, a bit like this:
- item 1
- item 2
+ sub item 1
+ sub item 2
- item 3
but I can't do it! Here is the code I thought would work:
<ul>
<li>Item 1</li>
<li>Item 2
<ul>
<li>Sub Item 1</li>
<li>Sub Item 2</li>
</ul>
</li>
<li>Item 3</li>
</ul>
This doesn't give the required result. It gives:
- Item 1
Item 2
+ sub item 1
- + sub item 2
- Item 3
What am I doing wrong???
Please note: I want my code to validate, that's why I've got the closing tags. I can achieve what I need by removing the closing tags, but this isn't valid, right?
Thanks,
Calum