I have a thumbnail inside a div. I use a different image as the background for the div so that it creates a thumbnail. I need to change the position of the background image from the bottom center to the top center when I click on the thumbnail.
Here is the html:
<div class="image">
<a class="zoom1" title="Sample title" href="images/xyz-large.jpg"><img src="images/portfolio-xyz.jpg" alt="XYZ Inc" /></a>
</div>
Here is the css:
div.image { width: 314px; height: 231px; background: url(images/bg_portfolio-img.png) no-repeat bottom center; }
div.image img { position: relative; top: 8px; left: 8px; }
I would like to do this with css only, and it would be something like this:
div image a.zoom1:hover { background-position: top center;}
However, this clearly does not work. I am open to jQuery solution, but I also need some help.
Thanks in advance for your help!
source
share