How to create an Image Overlay Zoom Effect on hover using CSS ? Last Updated : 05 Aug, 2024 Comments Improve Suggest changes Like Article Like Report Image Overlay Zoom Effect on hover can be done by using CSS. This effect is used in web design for user attention to images by highlighting the content or text, and to improve the overall look of a website by adding dynamic visual effects. We have given a Zoom effect to the text and image when the user hovers over the image.PreviewApproachFirst create a HTML structure with elements like <h1>, <h3>, <div> and <img>. Link the external stylesheet for styling purposes.Use CSS for giving smooth transition effect set the property transform 0.1s ease-in-out for the overlay.When the element having class named ".imageContainer" is hovered, the overlay element defined with a scale transformation for creating a zoom effect.The element .imageContainer > img defines the opacity of the image to 0.7.Adjusts the font size of the overlay element to 30px when the screen width is less than 1392px. Defines border, and border-radius for styling to the image.Example: Illustration to create an image overlay zoom effect on hover using CSS. HTML <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" href="style.css"> <title> Image Zoom Effect using CSS </title> </head> <body> <h1>GeeksforGeeks</h1> <h3> How to create an image overlay zoom effect on hover using CSS </h3> <div class="imageContainer"> <img src= "https://media.geeksforgeeks.org/wp-content/uploads/20231017114110/WEB-DESIGN-copy.webp" alt="Image"> <div class="overlayelement"> Welcome to GeeksforGeeks </div> </div> </body> </html> CSS /* style.css */ .overlayelement { position: absolute; top: 50vh; left: 35vw; font-size: 40px; font-weight: 700; transition: transform 0.1s ease-in-out; } .imageContainer:hover>.overlayelement { transform: scale(1.5); } .imageContainer:hover>img { transform: scale(1.2); } .imageContainer>img { opacity: 0.7 } .imageContainer { height: 300px; width: 600px; align-self: center; } img { height: 300px; width: 600px; border: 5px solid rgb(72, 33, 108); border-radius: 30px; transition: transform 0.1s ease-in-out; } body { display: flex; flex-direction: column; text-align: center; justify-content: center; height: 100vh; gap: 50px; } h1 { color: rgb(20, 87, 20); } @media only screen and (max-width: 1392px) { .overlayelement { font-size: 30px; } } Output: Comment More infoAdvertise with us Next Article How to create an Image Overlay Zoom Effect on hover using CSS ? S shivanigupta18rk Follow Improve Article Tags : Web Technologies Web Templates CSS-Questions Similar Reads How to Create an Image Overlay Fade in Text Effect on Hover using CSS ? In the context of web design, it's all about making dynamic and interesting user experiences(UI). Adding picture overlay effects to the website is a good method to improve the aesthetic appeal, especially when users interact with it by hovering over images. This article will walk you through the ste 3 min read How to create image overlay hover slide effects using CSS ? In this article, we will learn how to make image overlay hover slide effects using CSS. When the users hover over the image, a smooth sliding overlay effect occurs. This technique gives a visual appeal with interactivity, making your website more interactive.Table of ContentFull Width Slide-In Text 4 min read How to Create an Image Overlay Slide to Top Effect on Hover ? Image Overlay Sliding effect in CSS is a user interactive component triggered when the users hover the image and a smooth sliding overlay effect occurs in the application. Below are the approaches to create an image overlay slide-to-top effect on hover using CSS: Table of Content Using CSS Transitio 3 min read How to Create Image Overlay Hover using HTML & CSS ? In this article, we will go over 5 different types of overlays: left, right, top, bottom, and fade. You are going to need two divs. One will be your overlay div, containing what will show up once the user hovers over the image, and the other will be a container that holds both the image and its over 6 min read How to Create an Image Overlay Slide to Bottom Effect on Hover ? Image Overlay Sliding effect in CSS is a user interactive component triggered when the users hover the image and a smooth sliding overlay effect occurs in the application. These are the following approaches: Table of Content Using CSS TransitionUsing CSS KeyframesUsing CSS TransitionIn this approach 2 min read Like