Question:
How can I create a zoom effect on mouse hover on a HTML image without using tables or mask divs?
Answer:
Using the Transform Property with Scale
Consider utilizing CSS3's transform property to achieve a zoom-like effect using scale. Here's how:
HTML:
<div class="thumbnail"> <div class="image"> <img src="path/to/image.jpg" alt="Image hover effect"> </div> </div>
CSS:
.thumbnail { width: desired-width; height: desired-height; } .image { width: 100%; height: 100%; } .image img { transition: all 1s ease; } .image:hover img { transform: scale(1.25); }
Demo Explanation:
The above is the detailed content of How to Create a CSS Zoom Effect on Hover Without Tables or Masks?. For more information, please follow other related articles on the PHP Chinese website!