The elements with attribute inline-block
will behave as if they are inline (hence the name), and therefore any whitespace encountered will be treated as a space. For example:
<div></div><div></div>
will be rendered differently to
<div></div>
<div></div>
See a live example here
You can solve this problem using HTML as follows:
Either place all your elements on the same line, i.e.
<div>
// CONTENT
</div><div>
// CONTENT
</div><div>
// CONTENT
</div>
or use HTML comments to remove the spaces
<div>
//CONTENT
</div><!--
--><div>
//CONTENT
</div>
You can solve this problem using CSS as follows:
Set the attribute font-size: 0
on the parent, i.e.
parent {
display: inline-block;
font-size: 0
}
parent * {
font-size: 12px
}
or set the attribute zoom: 1
on the parent, i.e.
parent {
display: inline-block;
zoom: 1
}