Log in

View Full Version : Simple list question.



Jon101
10-14-2008, 07:39 PM
I know this is a beginner question and I am almost embarrassed to ask it, but here it goes..

Heres my situation:

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nullam lorem metus, pulvinar vel, ornare eget, semper non, arcu. Sed at tortor. Vestibulum ut massa. Aliquam quis leo.
<ul>
<li>bullet one</li>
<li>bullet two</li>
</ul>

How do i eliminate the space between the paragraph and my bullet points (the ul tag)?

Again, I'm sure this is a simple know-how but for some reason i don't recall how to do it.

thanks,
Jon

Moshambi
10-14-2008, 07:41 PM
Well since a <ul> is a block element it is going to automatically create a line break where you insert it. You can add CSS to make it in a line:


display: inline;

Do you want the items to go down vertically or do you want them horizontal?

Jon101
10-14-2008, 07:44 PM
Vertically is fine - i just need to eliminate the spacing between the paragraphs above and below the list.

if i do it like this: <ul style="display:inline"> it just floats left but not up.

Moshambi
10-14-2008, 07:49 PM
You could just add a negative margin in your <ul> like this:




<ul style='margin-top: -15px;'>




I think that might be what you're looking for.

Jon101
10-14-2008, 07:58 PM
Works like a charm.

Thanks much, friend.

Moshambi
10-14-2008, 07:59 PM
Glad to have helped :)