Search code examples
jquerypaddingsticky-footer

Calculate element height and apply to other element


Using a 'sticky footer', I need to have the bottom padding on the content div equal to the footer height.

I would like to use jQuery to grab the footer height and apply that value to the content div bottom padding value.

Hope that makes sense!

Thanks


Solution

  • var height = $('#footer').height();
    $('#content').css('padding-bottom',height+'px');
    

    I think this is the solution to your problem