Skip to content

Instantly share code, notes, and snippets.

@k1r8r0wn
Created July 29, 2015 06:59
Show Gist options
  • Save k1r8r0wn/c641dd62c0f1344519e3 to your computer and use it in GitHub Desktop.
Save k1r8r0wn/c641dd62c0f1344519e3 to your computer and use it in GitHub Desktop.
Close button in CSS
<a href="#" class="close">
.close {
position: absolute;
right: 0;
left: 20px;
top: 32px;
width: 21px;
height: 21px;
opacity: 0.3;
background: red;
border-radius: 50px;
&:hover { opacity: 1; }
&:before, &:after {
position: absolute;
left: 10px;
top: 6px;
content: '';
height: 11px;
width: 2px;
background: $white;
}
&:before { transform: rotate(45deg); }
&:after { transform: rotate(-45deg); }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment