I was trying to practice "background-image" but it didn't work correctly.
.box{
border: 5px solid rgb(255, 20, 59);
background-color: #ddd;
height: 100px;
width: 200px;
display: inline-block;
margin: 10px;
padding: 14px;
box-sizing: border-box;
cursor: pointer;
transition-duration: 0.5s;
}
.box:hover{
opacity: 60%;
transform: 2s;
}
#box1{
background-image: url(pre-left.png);
background-size: cover;
}
#box3{
background-image: url(pre-right.png);
background-size: cover;
}
#box2{
text-align: center;
position: relative;
top: -52px;
font-weight: bold;
font-size: 43px;
}
#box2:hover + #box3{
background-image: url(right.png);
transition-duration: 1s;
}
#box2:hover + #box1{
background-image: url(left.png);
transition-duration: 1s;
}
so on I was trying to change box1 and box3 background when box 2 being hovered but what happens is changing the background of only box3 not 1