How to make a div responsive height between header and footer with CSS only?

前端 未结 9 1085
隐瞒了意图╮
隐瞒了意图╮ 2021-01-18 15:15

I have an HTML page with fixed height header and footer and a element in between.

I want the element to have always the total height of the screen (excluding the h

9条回答
  •  逝去的感伤
    2021-01-18 15:42

    Fix both header and footer using position:fixed; and for content use

    padding: 60px 0;
    height: 100%;
    box-sizing: border-box;
    

    http://codepen.io/anon/pen/xGRyNW

提交回复
热议问题