Skip to content

Instantly share code, notes, and snippets.

@davidtrushkov
Forked from gartenfeld/centering.css
Created September 27, 2016 01:06
Show Gist options
  • Save davidtrushkov/e21ab6aa7c08149d8a609e45c5eee41c to your computer and use it in GitHub Desktop.
Save davidtrushkov/e21ab6aa7c08149d8a609e45c5eee41c to your computer and use it in GitHub Desktop.
Centering without Flexbox
// Add full screen wrapper
.box {
top: 50%;
left: 50%;
margin: 0;
position: absolute;
transform: translate(-50%, -50%);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment