Animate but stay in place?

I have these image buttons on my Services page. (See picture.) I was thinking it would be cool if when you hover over one, it could rotate left and right. Not totally come into view, like when you animate an object usually. But, stay right where it is on the page and just rotate left and right, like a little gear. I feel like I know how to write the code for it except for what you would call the animation. It is ok if that isn’t possible, but I thought I would ask.

I see no image

Oh no! Here, let me try that again . . .