Skip to content

Instantly share code, notes, and snippets.

@jasonbellamy
Last active August 29, 2015 14:16
Show Gist options
  • Save jasonbellamy/b2c5fe1ed720e912b1e1 to your computer and use it in GitHub Desktop.
Save jasonbellamy/b2c5fe1ed720e912b1e1 to your computer and use it in GitHub Desktop.
Modal overlay created using CSS box-shadow.
<div class="modal">
modal content
</div>
.modal {
background: red;
color: rgb(255, 255, 255);
width: 25%;
padding: 1em;
position: relative;
top: 50%;
left: 50%;
transform: translate(-50%, 50%);
box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment