I'm trying to change my grayscale value from 100 to 0 of a class when i hover on another class. Following is my code
<div className="width_100">
<img src={selfie} className="points_profilepic"
title="Upload your profile picture"/>
<input type="file" onChange={this.onImageChange.bind(this)}
className="points_picture_file" accept="image/*"/>
</div>
dafault greyscale value of class points_profilepic
is filter: grayscale(100%);
. I want to make it filter: grayscale(0%);
when i hover on class points_picture_file
. I have tried several ways but did not work.
my css
.points_profilepic{
height: 110px;
margin-top: 10px;
border-radius: 4px;
transition: all 0.5s ease;
filter: grayscale(100%);
}
.points_picture_file{
height:110px;
width:120px;
position: absolute;
margin-left: -120px;
margin-top: 10px;
opacity: 0;
cursor: pointer !important;
}
I tried
.points_picture_file:hover ~.points_profilepic{
filter: grayscale(0);
}
.points_picture_file:hover +.points_profilepic{
filter: grayscale(0);
}
But above methods did not work.