-1

I want to achieve this functionality as shown in image.

Image on left is orignal and when I hover over that image, Some color defined by us should overlay image as shown in Right. I have tried using CSS no use. I was trying to achieve this thru SVGs, but I am not much experienced in it. Is there any method which can be used to achieve this effect.

UPDATE

  • I don't want to use any extra image on hover.
  • I may be able to select any other color instead of black on hover.
JayKandari
  • 1,228
  • 4
  • 16
  • 33

3 Answers3

0

This is possible with webkit-filter.

Please try for not hovered image:

img {
    -webkit-filter: contrast(10) grayscale(1);
}

And then drop all filters on hovered:

img:hover {
    -webkit-filter: none;
}

What you have to know, NOT ALL browsers supports -webkit-filter. Also its nice idea to check this page. It will help you with finding correct values.

Kasyx
  • 3,170
  • 21
  • 32
0

use can use two Images on hover u can show second image and hide first image.similarly u can do this with second image

Ramniwas chhimpa
  • 205
  • 1
  • 2
  • 10
0

propose here is a solution using sprites demo

<div class="picture-hover"></div>

.picture-hover {
            background: url(https://i.stack.imgur.com/55veX.png);
            width: 239px;
            height: 180px;
        }
        .picture-hover:hover {
            background: url(https://i.stack.imgur.com/55veX.png);
            width: 239px;
            height: 180px;
            background-position: -239px 0px;
        }
Alex Wilson
  • 2,421
  • 11
  • 13