<h2>Image Overlay Hover Effect</h2>
<div class="container">
<a href="#">
<div class="overlay"></div>
<span>Click to see more...</span>
</a>
</div>
/* Credit image : Unsplash - pine watt */
@import url(https://fonts.googleapis.com/css?family=Open+Sans);
$font-family: 'Open Sans', sans-serif;
*,
*:before,
*:after{
margin: 0;
padding: 0;
box-sizing: border-box;
}
body{
background: #f9f9f9;
font-family: $font-family;
font-size: 16px;
}
a{
color: inherit;
text-decoration: none;
}
h2{
color: #c55;
padding: 50px 0;
text-align: center;
text-transform: uppercase;
font-size: 1.8rem;
}
.container{
background: url('https://source.unsplash.com/2Hzmz15wGik');
background-size: cover;
background-position: center center;
position: relative;
margin: auto;
width: 250px;
height: 250px;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
border-radius: 50%;
cursor: pointer;
overflow: hidden;
&:hover .overlay{
opacity: 1;
width: 100%;
height: 100%;
}
&:hover span{
opacity: 1;
-webkit-transform: scale(1);
transform: scale(1);
-webkit-transition: transform .5s ease, opacity 1.3s ease;
transition: transform .5s ease, opacity 1.3s ease;
}
.overlay{
background: rgba(0,0,0,0.4);
position: absolute;
margin: auto;
width: 0px;
height: 0px;
top: 0;
right: 0;
bottom: 0;
left: 0;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
border-radius: 50%;
opacity: 0;
-webkit-transition: .4s ease;
transition: .4s ease;
}
span{
color: #fff;
text-align: center;
position: absolute;
margin: auto;
width: 200px;
height: 30px;
line-height: 30px;
left: 0;
top: 0;
right: 0;
bottom: 0;
opacity: 0;
-webkit-transform: scale(0);
transform: scale(0);
-webkit-transition: transform .5s ease, opacity .7s ease;
transition: transform .5s ease, opacity .7s ease;
}
}
View Compiled
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.