I have one question about css. Here is example.
html:
<div class="image"></div>
css:
.image {
width: 250px;
height: 250px;
background-image: url(image.jpg);
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
.image:hover {
background-size: 120% 120%;
}
So In this example everything working fine. When I hover on image, image is zoomed. However I have a lot of images like this and it’s not good for SEO to use for every image div, and I want to use < img > tag but there isn’t such thing like “background-size”. Is there any way to do so with img?
4
Answers
Try This:
Please try this. I have done by scale property.
Hope this snippet helps you.
I don’t really get what you want to achieve but in your code
is equivalent in display to