I have a css file that has a background image that moves on hover
.bg {
width: 400px;
height: 240px;
margin: auto;
background: url (....) no-repeat center center;
background-size: 100%;
/ * work with the background-size * /
transition: background-size 1s ease-in-out;
position: relative;
z-index: 1;
box-shadow: 0 4px 8px 0 rgba (0, 0, 0, 1);
}
.bg: hover {
background-size: 120% / * work with the background-size * /
}
.bg :: before {
position: absolute;
content: '';
width: 100%;
height: 80px;
background: rgba (0, 0, 0, .5);
bottom: 0;
left: 0;
z-index: -1;
}
It works great.
The problem is that if I set a nice background image in react it does not respond to me when hover
<div
class = "bg"
style = {{
background: `url (" ... ") no-repeat center center / 100% 100%`,
}}
>
I searched the net and found no answer what can we do?