There are several options to displaying inline-block elements in a easily read manner, none of which are perfect.
Option 1: Left Floats
Here is a tutorial on Floats in general: http://css.maxdesign.com.au/floatutorial/
It is highly recommended for all front end developers to be well versed in this subject.
Option 2: Nested comments (already posted)
<div>
<img src="img1.jpg"/><!--
--><img src="img2.jpg"/>
</div>
Option 3 (potentially in the future): text-space-collapse: discard;
(previously white-space-collapse: discard;
)
The CSS property white-space-collapse
is not recommended because of poor browser adoption (see comment below). It appears this property is no longer a part of the text decoration specification. I have also found reference to text-space-collapse
as being considered for the future.
Option 4: Don't try
You can't expect to have beautiful code when using display:inline-block. It is my opinion that your use of inline-block and desire of beautiful code are mutually exclusive without use of float:left.
Option 5: Add font-size: 0
to a parent element. Apparently this doesn't work with Safari, so the solution is of similar value to white-space-collapse: discard;
.