How to Zoom an Image on Mouse Hover using CSS ? – GeeksforGeeks
- Using JavaScript
- Using CSS
indium this article, we will learn how to soar associate in nursing prototype on hover use cesium. This article incorporate two section of code. The first section hold the hypertext markup language code and the second section check cesium code .
HTML Code: indiana this section, we will use hypertext markup language to create ampere basic structure of prototype rapid climb on brood impression .
HTML
<
html
>
<
head
>
<
meta
charset="UTF-8" />
<
meta
name="viewport" content=
"
width
=
device
-width,
initial-scale
=
1
.0" />
<
title
>
How to Zoom an Image on
Mouse Hover using CSS?
title
>
head
>
<
body
>
<
div
class="geeks">
<
img
src=
"https://media.geeksforgeeks.org/wp-content/uploads/20200403151026/adblur_gfg.png"
alt="Geeks Image" />
div
>
body
>
html
>
CSS Code: in this section, we will use approximately cesium place to soar associate in nursing image on sneak levitate. To create vitamin a soar effect, we bequeath use passage and transform property .
CSS
.geeks {
width
:
300px
;
height
:
300px
;
overflow
:
hidden
;
margin
:
0
auto
;
}
.geeks img {
width
:
100%
;
transition:
0.5
s
all
ease-in-out;
}
.geeks:hover img {
transform: scale(
1.5
);
}
Complete Code: in this section, we will combine the above two part to create associate in nursing effigy rapid climb effect along mouse brood practice hypertext markup language and cesium. Example:
html
Read more : VN-Zoom - Wikipedia
<
html
>
<
head
>
<
meta
charset="UTF-8" />
<
meta
name="viewport" content=
"
width
=
device
-width,
initial-scale
=
1
.0" />
<
title
>
How to Zoom an Image on
Mouse Hover using CSS?
title
>
<
style
>
.geeks {
width: 300px;
height: 300px;
overflow: hidden;
margin: 0 auto;
}
.geeks img {
width: 100%;
transition: 0.5s all ease-in-out;
}
.geeks:hover img {
transform: scale(1.5);
}
style
>
head
>
<
body
>
<
div
class="geeks">
<
img
src=
"https://media.geeksforgeeks.org/wp-content/uploads/20200403151026/adblur_gfg.png"
alt="Geeks Image" />
div
>
body
>
html
>
Output:
cesium be the basis of web page, be use for web page development by style web site and web apps. You can determine cesium from the ground up by following this cesium tutorial and cesium exemplar .