Last active
December 17, 2018 13:20
-
-
Save wiseoldman/87a1866a6487cb59ec4bf0037e39623a to your computer and use it in GitHub Desktop.
[Single div X button] Close button created with a single div and pseudo elements #close #button #scss
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
$xSize: 40px; | |
$xColor: #000; | |
.x-btn { | |
cursor: pointer; | |
width: $xSize; | |
height: $xSize; | |
position: relative; | |
&:before, &:after { | |
content: ''; | |
background: $xColor; | |
position: absolute; | |
top: 50%; | |
height: 2px; | |
width: 100%; | |
} | |
&: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