how to size a div's height to its container height, using CSS?

后端 未结 14 2171
太阳男子
太阳男子 2020-12-16 19:34

How to size a div\'s height to its container height, using CSS ?


  
14条回答
  •  感动是毒
    2020-12-16 20:01

    I did something similar to KyokoHunter:

    $('div.row').each(function(){
         var rowHeight = $(this).innerHeight();
         $(this).children('div.column').css('height',rowHeight);
    });
    

    This goes through every row in a div "table" and makes the heights all match, as long as the divs are classed accordingly.

提交回复
热议问题