JSFiddle - React, Tailwind, and code Playground
HTML
<div class="grayscale">
<img class="bird" src="http://jpowell43.mydevryportfolio.com/flatDesign/images/birds.svg" alt="birds" />
<p class="title"><strong>The wild Swallow bird</strong><br />This crazy and unique bird loves to fly over the sky in search of a tasty div tag</p>
</div>
CSS
.grayscale {
width: 200px;
height: 200px;
position: relative;
margin: 0 auto;
top: 30px;
border: 3px solid rgba(0, 0, 0, 0.6);
padding: 10px;
background: rgba(255, 255, 255, 0.5);
}
.bird {
width: 100%;
height: 100%;
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'1 0 0 0 0, 0 1 0 0 0, 0 0 1 0 0, 0 0 0 1 0\'/></filter></svg>#grayscale");
-webkit-filter: grayscale(100%);
}
.bird.active {
-webkit-filter: grayscale(100%) !important;
}
.bird:hover {
-webkit-filter: grayscale(0%);
}
.grayscale p {
position: absolute;
bottom: 0;
left: 0;
display: none;
}
.grayscale:hover p {
display: inline;
}
.grayscale p:hover strong { /* Can be h1, h2, span, etc... */
color: brown;
}
.title.active {
-webkit-filter: grayscale(0%) !important;
}