Html – Vertical center image in div differences in Safari and FireFox

html

I currently am comparing this in Safari and Firefox.
A small image inside a div, which I need to center vertically.

Here is a simple test case that I have distilled down:
http://dl.getdropbox.com/u/340087/Drops/09.23.09/so-03f73322-164033.html

This one is probably even more simple:
http://dl.getdropbox.com/u/340087/drops/09.23.09/align-42fc19f2-154007.html

1) Why do I need a space after the image in order to get any align css to work?

2) What can I do to get Safari to perfectly center, it is 1-2px too low, essentially lining up the top of the image with the text.

Thanks

Best Answer

Images are considered inline elements, so they're basically treated as text.

If you want exact positioning across browsers, the safest way is to use the image for a background, rather than an inline img element.