Skip to content

Instantly share code, notes, and snippets.

@bretmorris
Last active December 18, 2015 03:19
Show Gist options
  • Save bretmorris/5717163 to your computer and use it in GitHub Desktop.
Save bretmorris/5717163 to your computer and use it in GitHub Desktop.
Lightbox CSS
.overlay {
position: absolute;
z-index: 1000; /* Something high */
height: 200px;
width: 200px;
background: white;
top: 50%;
left: 50%;
margin-left: -100px; /* Negative half width */
margin-top: -100px; /* Negative half height */
box-shadow: 0 0 0 2038px rgba(0,0,0,.5); /* The semi-transparent bg. Something weird about Safari and numbers bigger than this */
-webkit-transition: 1s; /* Little extra spice */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment