I am looking to achieve a unique effect with my thumbnail image and background. Currently, I have the thumbnail image inside a div with another image serving as the background to frame it. My goal is to change the position of the background image from bottom center to top center when hovering over the thumbnail.
Below is the example code:
<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>
And here is the related 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 accomplish this purely using CSS, such as the following snippet:
div image a.zoom1:hover { background-position: top center;}
Unfortunately, the above CSS code does not work as intended. I may be open to using a jQuery solution, but I would need some guidance on that front as well.
Thank you in advance for your assistance!