Hi Welcome to Sitepoint
,
No you don't want to use heights as you rightly say when you are holding fluid content. The problem in your first example is simply that images are treated like text and stacked on the base line which leaves room underneath for descenders. As an image doesn't have a descender you get a small gap instead.
If you set the image to display:block it will no longer be treated like text and will not have a gap underneath.
I always set my images to block at the start of the stylesheet because more often than not that's what is needed.
e.g.
Code:
img{display:block;border:none}
I always remove the border also as linked images get a blue border by default in some browsers and looks nasty.
If you need images to be inline elements then just add a class to them and set them back to display:inline where needed. For inline images you can also try setting the vertical alignment to counter the gap. e.g. img{vertical-align:bottom}. That will usually work but sometimes just moves the gap around to the top instead.
Bookmarks