I am trying to zoom in to the background but the elements inside the div get affected by it. I tried using this part with transform scale but the elements get zoomed in with the bg zoom in
.img-background {
background-image: url(./img.jpg);
height: 100vh;
width: 100vw;
background-repeat: no-repeat;
position: relative;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
background-position: 48% 10%;
}
.bg-img-animate {
animation-name: bg-animate;
animation-duration: 3s;
animation-iteration-count: 1;
animation-fill-mode: forwards;
-webkit-animation-fill-mode: forwards;
}
@keyframes bg-animate {
from {
transform: scale(1);
}
to {
transform: scale(2);
}
}
js
<div
className="img-background bg-img-animate">
<h2>text </h2>
</div>