This is a simple question and the answer is not so simple.
One can try to avoid the spaces in the source code which is not always achievable in CMS, because there they are automatically inserted by the system. If you want to change this you have to dig deep inte the CMS's core code.
Then you can try to use left floated images. But this is dangerous. At first you don't really have a control over vertical-alignment by definition. And secondly, you run into total chaos if you have so many floated elements, that they stretch over more than one line. And if you have a layout that relies on left floated elements (most of them do so today) you can even break some outer floating styles, if you clear floating after the images. This can be overridden, if you float any surrounding element. Rather not to be recommended.
So the only solution would be a CSS declaration that handles the process of whitespace handling. This is not part of any standard (as CSS 3 is not yet finished).
I prefer the no whitespace in HTML variant. With using drupal as CMS this can be achieved rather easy in your template.php and theming files. Then I choose inline-block.
P.S.:
inline-block is rather complicated to get in the different browsers.
For FF 2 you need display: -moz-inline-box.
The rest and IE8 can have display: inline-block right after.
And for lte IE 7 you need display: inline in a following separate declaration (preferrably via conditional comments).
edit
What I use for making a element inline-block
elem.inline {
display: -moz-inline-box; /* FF2 */
display: inline-block; /* gives hasLayout in IE 6+7*/
}
/* * html hack for IE 6 */
* html elem.inline {
display: inline; /* elements with hasLayout and display inline behave like inline-block */
}
/* * + html hack for IE 7 */
* + html elem.inline {
display: inline; /* elements with hasLayout and display inline behave like inline-block */
}
img
tag is a shorttag). – Bergenletter-spacing: -0.31em;
to remove the whitespaces. – ChamoispreserveWhitespaces
: softwarearchitekt.at/post/2017/08/31/… – Airliah