Skip to content

Instantly share code, notes, and snippets.

@clemgrim
Created December 30, 2015 15:52
Show Gist options
  • Save clemgrim/931c5fd5bb6f1e02a180 to your computer and use it in GitHub Desktop.
Save clemgrim/931c5fd5bb6f1e02a180 to your computer and use it in GitHub Desktop.
.block {
text-align: center;
}
.block:before {
content: '';
display: inline-block;
height: 100%;
vertical-align: middle;
margin-right: -0.25em; /* Adjusts for spacing */
}
.centered {
display: inline-block;
vertical-align: middle;
padding: 10px 15px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment