Skip to content

Instantly share code, notes, and snippets.

@tehsquidge
Last active August 4, 2016 21:32
Show Gist options
  • Save tehsquidge/3db0c24297fa05bdc343 to your computer and use it in GitHub Desktop.
Save tehsquidge/3db0c24297fa05bdc343 to your computer and use it in GitHub Desktop.
.middle-align:before { content: ''; display: inline-block; height: 100%; width: 0; vertical-align: middle; }
.middle-align > * { vertical-align: middle; }
.justify-align { margin-bottom: -1.2em; /* line-height compensation */ text-align: justify; -moz-text-align-last: justify; -webkit-text-align-last: justify; /* not implemented yet, and will not be */ text-align-last: justify; /* IE */ }
.justify-align:after { content: ''; display: inline-block; width: 100%; }
.justify-align > * { text-align: left; }
/* adjust spacing between inline-block (we need to keep spaces to justify) */
.middle-align, .justify-align { letter-spacing: -.54em; word-spacing: -.13em; }
.middle-align > * , .justify-align > * { display: inline-block; letter-spacing: normal; word-spacing: normal; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment