Skip to content

Instantly share code, notes, and snippets.

@lucasdavila
Created December 24, 2015 15:10
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 lucasdavila/019919db6cbd4297cd9b to your computer and use it in GitHub Desktop.
Save lucasdavila/019919db6cbd4297cd9b to your computer and use it in GitHub Desktop.
Fix middle alignment
function fixMiddleAlignment() {
var header = $('.middle.aligned'),
halfOfHeight = header.height() / 2;
header.css('position', 'relative');
header.css('top', 'calc(50% - ' + halfOfHeight + 'px)');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment