Yogesh Chauhan's Blog

How to zoom an element on hover using CSS?

in CSS on March 2, 2021

Zoom is nothing but a larger view of the object.

We can use transform property of CSS and increase the object size.

The scale() method is helpful to make the object larger.

Let’s add the HTML first and start with a simple div element with a class name hover-zoom.

Let’s add some style to make the div visible.

Finally, add the hover style and make the div element bigger on hover.

Let’s add transition property to add a nice smooth animation.


Most Read

#1 Solution to the error “Visual Studio Code can’t be opened because Apple cannot check it for malicious software” #2 How to add Read More Read Less Button using JavaScript? #3 How to check if radio button is checked or not using JavaScript? #4 Solution to “TypeError: ‘x’ is not iterable” in Angular 9 #5 PHP Login System using PDO Part 1: Create User Registration Page #6 How to uninstall Cocoapods from the Mac OS?

Recently Posted

#Apr 8 JSON.stringify() in JavaScript #Apr 7 Middleware in NextJS #Jan 17 4 advanced ways to search Colleague #Jan 16 Colleague UI Basics: The Search Area #Jan 16 Colleague UI Basics: The Context Area #Jan 16 Colleague UI Basics: Accessing the user interface
You might also like these
Learn to create profile card using HTML and CSSCSSHow to show slider value in HTML5 range input using JavaScript?HTMLHow to Access a Global Variable From Inside a Function in PHP?PHPObject destructuring in JavaScript: Unpacking fields from objects passed as function parameterJavaScriptHow to overwrite file contents with new content in PHP?PHPWhat are Web services?MiscellaneousHow to convert a function component into a class in React?ReactValues and Types Basics in JavaScriptJavaScriptWordPress get_posts ExamplesWordPressHow to set opacity or transparency using CSS?CSSHow to make a curtain slider using jQuery and CSS?CSSHow to Validate User Name, Email Address and URL in PHP?PHP