When the mouse hovers over an image, it changes to another image. Everything works smoothly except for one issue - the image is not centered. Below is the code I am currently using:
HTML:
<figure>
<a>
<img class="hover" src="nachher.jpg" alt="" width="60%" />
<img class="nohover" src="vorher.jpg" alt="" width="60%/" />
</a>
<figcaption>some text here</figcaption>
</figure
CSS:
img.nohover {border:0;}
img.hover {border:0;display:none;}
a:hover img.hover {display:inline;}
a:hover img.nohover {display:none;}
The main question arises: How can I center the image(s) within the figure?