Skip to content

Instantly share code, notes, and snippets.

@denvers
Created August 12, 2013 06:04
Show Gist options
  • Save denvers/6208556 to your computer and use it in GitHub Desktop.
Save denvers/6208556 to your computer and use it in GitHub Desktop.
Absolute Centered Position (IE8+, Firefox, Chrome, etc.)
/* Within container */
.Absolute-Center {
width: 50%;
height: 50%;
overflow: auto;
margin: auto;
position: absolute;
top: 0; left: 0; bottom: 0; right: 0;
}
/* Within Viewport */
.Absolute-Center.is-Fixed {
width: 50%;
height: 50%;
overflow: auto;
margin: auto;
position: fixed;
top: 0; left: 0; bottom: 0; right: 0;
z-index: 999;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment