CSS: Unwanted Space Between Images

December 1, 2009


This issue presents itself when the doctype is set to strict mode.  Basically, if there are two images that are aligned vertically, a space will appear between the two images.  This is a result of the images being treated as text, so the browser leaves room below each image for characters that drop below the line (such as "g", "p",or "y").  To solve this issue, assign "vertical-align: bottom" to the style of the top image (or both images if preferred). 



Bookmark and Share

Tags:

blog comments powered by Disqus