Possible Duplicate:
Unwanted margin in inline-block list items
How to remove “Invisible space” from HTML
I have an <ul>
with multiple <li>
children.
The li
's just contain an image, and I removed all the margin from them.
I also called display:inline-block;
on them, so they are now displayed in one line.
However, there is still a small margin on the right side of the li
s.
I found out that it's the line break, and that, if I remove it the margin disappear.
However, it's very unreadable if I have to remove all the line breaks.
Can you give me a solution for this one?
HTML
<ul>
<li><a href="#"><img src="image1.png" alt="post_heart" /></a></li>
<li><a href="#"><img src="image2.png" alt="post_repeat" /></a></li>
<li><a href="#"><img src="image3.png" alt="post_tag" /></a></li>
<li><a href="#"><img src="image4.png" alt="post_share" /></a></li>
</ul>
LESS
ul {
display:inline;
padding:none;
margin:none;
li {
display:inline-block;
padding:none;
margin:none;
a {
display:block;
margin:none;
border-right: 1px solid #e0e1e2;
&:hover {
.linearGradient(transparent, rgba(0,0,0,0.05));
}
}
&:last-child {
a {
border:none;
}
}
}
}