pooja pooja - 3 months ago 9
CSS Question

how to change the image as black and white when it is hovered with the blur effect

now i want to change this to black and white image so can anyone help me



BLUR*/
.blur img {
-webkit-transition: all 1s ease;
-moz-transition: all 1s ease;
-o-transition: all 1s ease;
-ms-transition: all 1s ease;
transition: all 1s ease;
}

.blur img:hover {
-webkit-filter: blur(5px);
}

<div class="blur pic">
<img src="http://www.spyderonlines.com/images/wallpapers/pic-of-nature/pic-of-nature-3.jpg" >
</div>




Answer

.bw {
  -webkit-transition: all 1s ease;
     -moz-transition: all 1s ease;
       -o-transition: all 1s ease;
      -ms-transition: all 1s ease;
          transition: all 1s ease;
}
 
.bw:hover {
  -webkit-filter: grayscale(100%);
}
<div class="bw pic">
  <img src="http://www.spyderonlines.com/images/wallpapers/pic-of-nature/pic-of-nature-3.jpg" >
</div>

Comments