Solution: Add "vertical-align:bottom;" to the image style.
Another solution, not always suitable, is to change the image display
type to block
, instead of it's original inline
display type.
Explanation: The problem occurs due to the automatic behavior of browsers that add a space under the text for characters that are longer than usual. The image is an inline object like text, thus it has a space underneath too.
A great explanation is written in quirksmode.org:
Complication: almost strict mode
In the early days, experiments with
strict mode invariably raised the
comment that images suddenly got an
odd bottom margin that couldn’t be
removed. The cause was that in strict
mode is an inline element,
which means that some space should be
reserved for possible descender
characters like g, j, or q. Of course
an image doesn’t have descender
characters, so the space was never
used, but it still had to be reserved.
The solution was to explicitly declare
images block level elements: img
{display: block}.
Nonetheless browser vendors, Mozilla
especially, thought this was such a
confusing situation that they
introduced "almost strict mode". This
was defined as strict mode, but with
images continuing to be blocks, and
not inline elements.
Most common doctypes, including the
one I use, trigger almost strict mode.
The treatment of images is by far the
most important difference between
almost strict mode and really strict
mode.
Generally you should use a CSS reset document that avoids problems such as this one.