Skip to content

Instantly share code, notes, and snippets.

@pustynnykh
Created June 19, 2014 10:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pustynnykh/04071328a36d24c85448 to your computer and use it in GitHub Desktop.
Save pustynnykh/04071328a36d24c85448 to your computer and use it in GitHub Desktop.
Cool hover-effect using :after
<div class="wrapper">
<div class="circle"></div>
</div>
.wrapper {
background: #000;
width: 100px;
height: 100px;
position: relative;
}
.circle {
width: 50px;
height: 50px;
background: #fff;
position: absolute;
left: 25px;
top: 25px;
border-radius: 50%;
}
.circle:after {
content: "";
display: block;
position: absolute;
top: -8px;
left: -8px;
width: 100%;
height: 100%;
box-shadow: 0 0 0 2px #fff;
padding: 8px;
border-radius: 50%;
transition: all 0.5s ease;
opacity: 0;
-webkit-transform: scale(.8);
transform: scale(.8);
}
.circle:hover:after{
opacity: 1;
-webkit-transform: scale(1);
transform: scale(1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment