Skip to content

Instantly share code, notes, and snippets.

@avclark avclark/gist:7514123
Created Nov 17, 2013

What would you like to do?
Vertically center block elements
// We use this to vertically center block elements
.vertical-center {
&:before {
content: '';
display: inline-block;
height: 100%;
vertical-align: middle;
margin-right: -0.25em; /* Adjusts for spacing */
div {
display: inline-block;
vertical-align: middle;
width: auto;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.