As I mentioned in my comment, you cannot move the background-image property, but you can get the effect you are looking for if you want to add additional markup, and then go to opacity. So you will have this markup:
<nav> <ul> <li> <img src="no-icon.png"> <img src="yes-icon.png"> <a id="foobar" href="http://www.google.com/search?q=foobar">Foobar</a> </li> </ul> </nav>
Then set the transition on the images, set them to the absolute position (so that they look like backgrounds) and hide one of them by default (clarity did not limit for clarity):
nav li img { position: absolute; transition-duration: 1.5s; opacity: 1; } nav li img:first-child { opacity: 0; }
Then replace the opacity values ββwith li:hover :
nav li:hover img { opacity: 0; } nav li:hover img:first-child { opacity: 1; }
Here is a complete working example . Not a perfect solution, because you need to add extra markup, but it will work.
source share