My collection includes three transparent PNG images:
https://i.sstatic.net/80Jxj.png
https://i.sstatic.net/Eewcq.png
https://i.sstatic.net/VXk7A.png
I have arranged them using the following HTML/CSS:
<div style="position: relative; left: 0; top: 0;">
<img src="img/main.png" style="position: absolute; top: 0; left: 0;" />
<img src="img/middle.png" style="position: absolute; top: 0; left: 0;"/>
<img src="img/center.png" style="position: absolute; top: 0; left: 0;"/>
</div>
This arrangement results in:
https://i.sstatic.net/igHhy.png
Now, I would like to add a hover effect to each of these images (such as zooming in, adding borders, changing opacity, etc).
The standard CSS for zooming in on hover is:
img {
-webkit-transition: all 1s ease; /* Safari and Chrome */
-moz-transition: all 1s ease; /* Firefox */
-ms-transition: all 1s ease; /* IE 9 */
-o-transition: all 1s ease; /* Opera */
transition: all 1s ease;
}
img:hover {
-webkit-transform:scale(1.25); /* Safari and Chrome */
-moz-transform:scale(1.25); /* Firefox */
-ms-transform:scale(1.25); /* IE 9 */
-o-transform:scale(1.25); /* Opera */
transform:scale(1.25);
}
However, this does not work well with my setup since the hover effect applies to the entire image instead of just the image content (due to transparent backgrounds).
My question is whether it's possible to apply CSS styles to irregularly shaped transparent images?
View my jsfiddle here: http://jsfiddle.net/h4mxysw5/
Edit:
There seems to be confusion. I do not wish to zoom all three images simultaneously.
For instance, when hovering over the center image, only that specific image should zoom (not all three).
Check out the updated version on jsfiddle with added borders: http://jsfiddle.net/h4mxysw5/4/