I have several buttons with different background images. I would like to achieve to have a grayscale filter on them by default and on hover remove the grayscale filter.
I have this already but the problem is that the text of the buttons are also grayed out which i would like to avoid. I Couldn't figure out how to apply grayscale filter only on button backgrounds but not on text.
Now I have a main css class for the buttons
.box {
-webkit-filter: grayscale(100%);
filter: grayscale(100%);
position:relative;
color: red;
cursor:pointer;
text-align: center;
width: 160px;
height: 160px;
}
.box:hover {
-webkit-filter: grayscale(0%);
filter: grayscale(0%);
color: blue;
}
and I apply the backgrounds for each button in html code
<button onclick="buttonFunction()" button class="button box" style="background: url(background1.jpg); background-size: 100%;" >Gray button text:( </button>
Any idea how to add grayscale filter only button backgrounds and keep the button texts colored?
Thanks