ITPub博客

首页 > IT职业 > IT职场 > 设置 div自适应高度

设置 div自适应高度

IT职场 作者:flyingknife 时间:2021-09-09 10:00:14 0 删除 编辑

 

 

 

上部

 

中间部分

 

底部

 


jQuery('#right').css('min-height',(jQuery('body').height()-175)+"px");

 


175为top和bottom2部分高的和。也可通过jquery动态获取jQuery('#top').height()+jQuery('#bottom').height()


设置min-height最小高度,这样中间部分高度可以自动扩大






来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/393/viewspace-2814974/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2020-07-23

  • 博文量
    0
  • 访问量
    464