Created
July 29, 2015 06:59
-
-
Save k1r8r0wn/c641dd62c0f1344519e3 to your computer and use it in GitHub Desktop.
Close button in CSS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<a href="#" class="close"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.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