Skip to content

Instantly share code, notes, and snippets.

@akshayagarwal
Last active August 29, 2015 14:17
Show Gist options
  • Save akshayagarwal/7aeaba2b88adb7989ab5 to your computer and use it in GitHub Desktop.
Save akshayagarwal/7aeaba2b88adb7989ab5 to your computer and use it in GitHub Desktop.
Always position footer at bottom
(function($){
$(document).ready(function(){
if( $( window ).height() > $( 'body' ).height() ){
//Assuming the footer is represented by the <footer> HTML element
$( 'footer' ).css( 'margin-top' , $( window ).height() - $( 'body' ).height() );
}
})
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment