How to force child div to be 100% of parent div's height without specifying parent's height?

前端 未结 26 1994
刺人心
刺人心 2020-11-22 06:52

I have a site with the following structure:

<
26条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-22 07:38

    My solution:

    $(window).resize(function() {
       $('#div_to_occupy_the_rest').height(
            $(window).height() - $('#div_to_occupy_the_rest').offset().top
        );
    });
    

提交回复
热议问题