2 个回答

假定:header{height:60px;}footer{height:100px}
那么中间的main-box{min-height:calc(100% - 160px)}

不知道如果不用fixed,footer是不是还要固定在底部?

如果不固定,只是避免空隙的话,可以reset body的padding和margin为0

body, div, dl, dt, dd, ul, ol, li, pre, form, h1, h2, h3, h4, h5, h6, p, input{ padding:0; margin:0; }
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题