Zach Smith
Zach Smith

Reputation: 5674

Remove Spacing between li

How can I remove spacing between the li found here?

http://blog.raveis.com/badge/b.html

Confused on how to do this and I don't want to use negative margins. any help would be greatly appreciated.

Upvotes: 12

Views: 29894

Answers (5)

goonerify
goonerify

Reputation: 1748

Surprised that no one mentioned line-height on the ul element. It's possible I didn't get the full question because the original link is now broken, but generally, line-height might be the way to go

Upvotes: 0

zailleh
zailleh

Reputation: 11

This is rediculously late in the piece but I had the same problem today.

I fixed it by laying out my HTML like so, thereby removing any space between the list it:

<li>
  list-item 1
</li><li>
  list-item 2
</li><li>
  list-item 3
</li>

Example on Code Pen

Upvotes: 1

tsu1980
tsu1980

Reputation: 2632

Try this.

ul { font-size: 0; }

Upvotes: 7

rflmyk
rflmyk

Reputation: 569

Do you want using list center, you can using:

 ul { text-align: center; }
 li { margin-right: -4px; }

How on this link

Upvotes: 0

Josh Stodola
Josh Stodola

Reputation: 82483

Make your li tags display:block; and float:left; (instead of display:inline;)

Upvotes: 36

Related Questions