I have an <img> that is horizontal and vertical, and works in Chrome and Safari, but unfortunately not in Firefox. In Firefox, the <img> centered horizontally, but not vertically. How to fix it? Is this related to jquery animation?
Here you can see an example of my code: http://jsfiddle.net/amagdk/kan94az0/
HTML
<img src="hover-kitty.png" alt="Hover Kitty">
CSS
img { position: absolute; margin: auto; top: 0; right: 0; bottom: 0; left: 0; }
JQuery
$(document).ready(function(){ var hoverkitty = $("img"); function hover() { hoverkitty.animate({top:'+=20'}, 1000); hoverkitty.animate({top:'-=20'}, 1000, hover); } hover(); });
AnnaM source share