Skip to content

Instantly share code, notes, and snippets.

@jxnblk
Last active December 20, 2015 15:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jxnblk/6152708 to your computer and use it in GitHub Desktop.
Save jxnblk/6152708 to your computer and use it in GitHub Desktop.
Positioning utilities
.relative { position: relative; }
.absolute { position: absolute; }
.absolute-center {
position: absolute;
top:0;
right:0;
bottom:0;
left:0;
margin: auto;
}
.top { top: 0; }
.right { right: 0; }
.bottom { bottom: 0; }
.left { left: 0; }
.table { display: table; }
.table-cell { display: table-cell; vertical-align: middle; }
/**
* Example usage:
*
* <div class="relative">
* <div class="absolute top right"></div>
* </div>
*
* <div class="relative">
* <div class="absolute-center dtable"></div>
* </div>
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment