In a total mind blank and can't quite find the answer on Google - call it old age I think.
My problem:
I want to use a CSS created button to change an image on the same page when the user hovers over the button.
Eventually I will have 3 buttons, each one with an image sitting below it. When a user does a mouseover on each button then corresponding image below it would change from greyscale to colour.
I can make it work for a link, but if I apply the class to a CSS styled button, the button also becomes greyscale which I don't want to happen. This button style should be independent of the style that applies to the image state.
CSS:
.image1 {-webkit-filter: grayscale(100%); /* Safari 6.0 - 9.0 */
filter: grayscale(100%);}
.image1:hover{-webkit-filter: grayscale(0%); /* Safari 6.0 - 9.0 */
filter: grayscale(0%);}
.image2{-webkit-filter: grayscale(100%); /* Safari 6.0 - 9.0 */
filter: grayscale(100%);}
.image2:hover{-webkit-filter: grayscale(0%); /* Safari 6.0 - 9.0 */
filter: grayscale(0%);}
.image3{-webkit-filter: grayscale(100%); /* Safari 6.0 - 9.0 */
filter: grayscale(100%);}
.image3:hover{-webkit-filter: grayscale(0%); /* Safari 6.0 - 9.0 */
filter: grayscale(0%);}
HTML:
<a href="#" class="image1">THIS WILL BE A BUTTON</a>
<br>
<img src="testimage.png" class="image1">
<a href="#" class="image2">THIS WILL BE A BUTTON</a>
<br>
<img src="testimage.png" class="image2">
<a href="#" class="image3">THIS WILL BE A BUTTON</a>
<br>
<img src="testimage.png" class="image3">