How do I remove the height style from a DIV using jQuery?

后端 未结 9 708
遇见更好的自我
遇见更好的自我 2020-12-13 23:04

By default, a DIV\'s height is determined by its contents.

But, I override that and explicitly set a height with jQuery:

$(\'div#someDiv\').height(so         


        
9条回答
  •  Happy的楠姐
    2020-12-13 23:33

    to remove the height:

    $('div#someDiv').css('height', '');
    $('div#someDiv').css('height', null);
    

    like John pointed out, set height to auto:

    $('div#someDiv').css('height', 'auto');
    

    (checked with jQuery 1.4)

提交回复
热议问题