Problem with numbered list

rbilleaud

New Member
Hi all, I'm new to the forum. I feel like such a novice and I know my questions are really basic, but web design is not my primary job. Sometimes though I am asked to do some minor things at work that have to do with coding for the web and I am the most web saavy of the lot. I like to say I know just enough to be dangerous. Here's my problem. This is a unique problem I haven't had to deal with before. I have an ordered list and one of the items on the ordered list has an unordered bulleted list below, so for example, my code looks like this:
<OL>
<LI>number list item 1 </LI>
<LI>number list item 2 </LI></OL>
<UL>
<LI>bullet list item 1 </LI>
<LI>bullet list item 2</LI></UL>

But now I want to continue my list at number list item 3. I tried taking the </OL> off to indicate I want to continue the list and placing it at the end of my code for list item 3, but the browser simply puts another bullet after the second bullet item, but promoted one level.

If anyone can help, I'd sure appreciate it - thanks.
 

CaldwellYSR

Member
Make sure everything is nested correctly. Make sure you closed the unordered list and everything. In the end it should look like.

<ol>
<li>numberedItem1</li>
<li>numberedItem2</li>
<li>numberedItem3</li>
<ul>
<li>bulletItem1</li>
<li>bulletItem2</li>
<li>bulletItem3</li>
</ul>​
<li>numberedItem4</li>
<li>numberedItem5</li>​
</ol>

That should get you what you want.
 

Phreaddee

Super Moderator
Staff member
actually that is almost right
numbered item 3 actually has to close after its child list
so

HTML:
<ol>
<li>numberedItem1</li>
<li>numberedItem2</li>
<li>numberedItem3
<ul>
<li>bulletItem1</li>
<li>bulletItem2</li>
<li>bulletItem3</li>
</ul>
</li>
<li>numberedItem4</li>
<li>numberedItem5</li>
</ol>
 

kayla

New Member
This isn't my thread, but I just tested what CaldwellYSR and Phreaddee said and got the same results. Is one more correct than the other? I don't even know which way I normally do... I'll have to wait and see next time it comes up.
 

CaldwellYSR

Member
actually that is almost right
numbered item 3 actually has to close after its child list
so

HTML:
<ol>
<li>numberedItem1</li>
<li>numberedItem2</li>
<li>numberedItem3
<ul>
<li>bulletItem1</li>
<li>bulletItem2</li>
<li>bulletItem3</li>
</ul>
</li>
<li>numberedItem4</li>
<li>numberedItem5</li>
</ol>

Interesting. I've never heard of that. I've always assumed the ul to be a child of the ol not the li?
 
Top