Last Updated: February 25, 2016
·
686
· jailandrade

Removing space between elements with inline-block

If you use display: inline-block </code> in CSS for align elements you can notice that exist space between the elements, if you wanna remove this space you have to put the container to font-size: 0 </code> and the elements using inline-block </code> you have to assign the font-size </code> to whatever unit you want.

ul {
font-size: 0;
margin: 0;
}

li {
display: inline-block;
font-size: 1em;
}

2 Responses
Add your response

This was very useful for me.

over 1 year ago ·

thanks for the tip :).

over 1 year ago ·