I'm currently working on a project and I really like the design on Fancy: . When you hover over an image, the background darkens and a button appears in the front.
What I want to achieve is similar, but with a SHARE button instead. I have the image displayed as an img, and the SHARE button as the background. However, I'm struggling with darkening the image without affecting the SHARE button.
Below is my HTML code:
<div class="src">
<img src="image.jpg" />
</div>
And here's my CSS code:
.src {
width: 100%;
height: 100%;
background: url('icon-share.png') center center no-repeat;
opacity: 1;
}
.src img {
width: 500px;
min-height: 200px;
opacity: 0.2;
}
If anyone can offer some help, it would be greatly appreciated.
The image always has a width of 500px, but the height can vary (with a minimum of 200px). I would also like to darken the image instead of just adjusting the opacity, but I think I can tackle that challenge.
EDIT: Just to clarify, clicking on the entire image will prompt the share dialogue. The floating SHARE button is simply there to indicate to the user that they will be sharing the image.