How to make the effect that an image magnifies to hover

Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Dean

Well-known member
Joined
Apr 23, 2019
Messages
105
Credits
122
In this guide I will explain with HTML & CSS how to make the effect that the image enlarges to hover.
First we write the HTML structure with the image:
HTML:
Expand Collapse Copy
<html>
<head>
<title>Titolo</title>
<meta charset="utf-8">
</head>
<body>
<img src="link img" class="classe">
</body>
</html>
Now in CSS (in the tag head through style sheet or through style) we insert:
CSS:
Expand Collapse Copy
img.classe

{

width:auto;

}

img.classe:hover

{

width:XXpx;

height:XXpx;

}
Now, instead of width: XXpx we put a number of px higher than the image and equal to height.
I hope the guide was helpful to you
 
Back
Top