Help - Search - Members - Calendar
Full Version: Horizontal list overlap
Invision Power Services > Community Forums > Community Web Design and Coding
=Charles
I have a horizontal list.
CODE
<ul>
<li>1</li>
<li>2</li>
</ul>

CODE
li { display: inline; }

I have lots of items in the list so it continues on the next line. The problem is that the second line is too close to the first. Is there a solution, using CSS, to this problem?

I've search Google to no avail. Thank you for reading. original.gif
Starnox
left margin should do it?

Or you could set them as blocks, float them left and add margins.
Rikki
Try line-height: 150%;
Starnox
Ah you can tell I didn't read the post, I thought you meant they lapped horizontally tongue.gif
_
You can use either margin- or padding-bottom, as far as I know.
=Charles
Thanks for the replies, guys. Rikki's suggestion did the trick. I got the desired effect by putting line-height: 250%; on the list elements (<li>).

One more thing though. The last list element on the first line is cut in two. Is there any way to make the whole <li></li> stay on the same line? There are 3 words in it and it splits between the second and third.

I should also add, the design has a fluid width, so setting a fixed width will not help. I can provide a screen shot, too:



As you can see, it's between "Indian Head" and "Massage" that the split occurs.
_
That won't work with inline display. You can use floats for things like this.
=Charles
I guess I'll just leave it as it is then. Thank you all! biggrin.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.