PDA

View Full Version : Can ul list be both?



Olwe
10 Sep 2011, 02:45 PM
I'm using a ul list with the li set to display: inline to get a horizontally listing menu. Nothing new. However, I also want the occasional vertical <li> item. Here's an example of my ugly code:



<ul>
<li>something</li>
<br />
<li>something else</li>
<br /><br />
<li>town, state</li>
<li>123.555.1212</li>
<li>something else</li>
<br /><br />
<li>something else below</li>
</ul>


Using the <br /> is a kludge that works, but I can't help but feel there's a better way to mix inline with regular lists. Any suggestions?

PS: It just occurred to me that I could use a separate "sub ul" within a regular vertical ul. Is that the best way. I come from a programming background and having everything inside ul/li seems very elegant.....