Removing Spaces Between Images Using CSS
The issue of space between images when displayed inline is a common concern. By default, browsers render any sequence of whitespace characters (spaces, tabs, newlines) as a single white space.
To eliminate this space, CSS offers a simple solution. By setting the display property of the image elements to block, you can force them to behave like block-level elements.
<code class="css">img { display: block; }</code>
This CSS rule modifies the display behaviour of all images on the page, ensuring they appear on their own lines, eliminating any whitespace between them.
<code class="html"><div class="nospace"> <img src="..." /> <img src="..." /> </div></code>
With this CSS rule applied to the
The above is the detailed content of How to Remove Spaces Between Inline Images Using CSS?. For more information, please follow other related articles on the PHP Chinese website!