How can I make DIV 100% height of browser without vertical scrolling of header

前端 未结 6 2228
遇见更好的自我
遇见更好的自我 2021-01-05 08:32

Both the left and right panels have a height of 100%, but since the Header div takes up X amount of space, there is some vertical scrolling in the window th

6条回答
  •  抹茶落季
    2021-01-05 08:57

    Use viewports. Browsers now support giving height a percentage of page height. Drop the 100 down to 80 if you've got a header taking up space.

    div {
        height:100vh;
    }
    

提交回复
热议问题