Created
February 26, 2015 22:52
-
-
Save jasonbellamy/5f050359f6045c5f1e6b to your computer and use it in GitHub Desktop.
Modal overlay created using CSS outline property.
This file contains hidden or 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
.modal { | |
background: black; | |
color: rgb(255, 255, 255); | |
height: 200px; | |
left: 50%; | |
position: relative; | |
text-align: center; | |
top: 50%; | |
transform: translate(-50%, 50%); | |
width: 200px; | |
/* create background "overlay" */ | |
outline: 9999px solid rgba(0,0,0,0.5); | |
z-index: 1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
love it!!! independently came up with today and I dig it for a few reasons:
document
listener to close the modal when the target wasn't inside the modal itself