Skip to content

Instantly share code, notes, and snippets.

@johnlewisdesign
Last active August 4, 2020 01:22
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 johnlewisdesign/e111a9a8d4952400dcea0ef49346e446 to your computer and use it in GitHub Desktop.
Save johnlewisdesign/e111a9a8d4952400dcea0ef49346e446 to your computer and use it in GitHub Desktop.
A close button X with a single div element
body{
background:#333;
}
div{
width:40px;
height:40px;
background-color:#333;
position:relative;
border-radius:6px;
box-shadow:2px 2px 4px 0 white;
}
div:before,div:after{
content:'';
position:absolute;
width:36px;
height:4px;
background-color:white;
border-radius:2px;
top:16px;
box-shadow:0 0 2px 0 #ccc;
}
div:before{
-webkit-transform:rotate(45deg);
-moz-transform:rotate(45deg);
transform:rotate(45deg);
left:2px;
}
div:after{
-webkit-transform:rotate(-45deg);
-moz-transform:rotate(-45deg);
transform:rotate(-45deg);
right:2px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment