Source Code: (back to article)
<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
<style>
.container {
position: relative;
width: 50%;
}
.image {
opacity: 1;
display: block;
width: 100%;
height: auto;
transition: .7s ease;
backface-visibility: hidden;
}
.middle {
transition: .7s ease;
opacity: 0;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
text-align: center;
}
.container:hover .image {
opacity: 0.4;
}
.container:hover .middle {
opacity: 1;
}
.text {
background-color: #009c36;
color: white;
font-size: 18px;