Vertical center image in div differences in Safari and FireFox
I am currently comparing this in Safari and Firefox. A small image inside a div that I need to center vertically.
Here is a simple test case I have removed: http://dl.getdropbox.com/u/340087/Drops/09.23.09/so-03f73322-164033.html
It's probably even easier: http://dl.getdropbox.com/u/340087/drops/09.23.09/align-42fc19f2-154007.html
1) Why do I need space after the image to make any css CSS work?
2) What can I do to get Safari to be perfectly centered, that's 1-2px too low, essentially aligning the top of the image with the text.
thank
+2
source to share
3 answers
Paste the text into the range and apply vertical alignment to it.
HTML snippet:
<div class="right">
<img src="action_check.png" width="16" height="16" class="status" alt="Data Ok" />
<span>Chose a User Name</span>
</div>
Adding CSS:
span { vertical-align: middle; }
Tested on the latest versions of FF, IE, Safari, Chrome and Opera (Windows).
+2
source to share