Skip to content

Instantly share code, notes, and snippets.

@mrkodssldrf
Created May 28, 2014 07:11
Show Gist options
  • Save mrkodssldrf/891d934d10de2492344c to your computer and use it in GitHub Desktop.
Save mrkodssldrf/891d934d10de2492344c to your computer and use it in GitHub Desktop.
Vertical align elements without fixed height
---CSS
/* Helper to vertical align content*/
.vhelper { height: 100%; padding: 0;}
/* Vertical-Alignment without given height */
.vhelper, .justify-middle { display: inline-block; vertical-align: middle; }
---HTML
<span class="vhelper"></span>
<div class="justify-middle">--Content--</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment