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
Sorting Object Arrays in JavaScriptJavaScriptHow to Find the Highest (or Lowest) Number in an Array in JavaScript?JavaScriptHow to define visibility for a property in PHP?PHP3 Ways we can create URLSearchParams Objects in JavaScriptJavaScriptHow to add Local State to a Class in React?React@forward rule in SCSS (Sass)SCSSHow to add Read More Read Less Button using JavaScript?JavaScriptIntroduction to Angular modules Part 3: NgModules vs JavaScript modules and Angular librariesAngularHow to zoom an element on hover using CSS?CSSOpen Source Security Tools for Defense SecurityMiscellaneousHow to create bouncing balls using HTML canvas and JavaScript?HTMLHow to avoid element shift on border change while hovering in CSS?CSS