For div to extend full height

前端 未结 5 735
轻奢々
轻奢々 2020-11-28 07:08

Is there a method I can use for a div to extend to full height? I\'ve got a sticky footer in it as well.

Here\'s the web page: Website removed. The

5条回答
  •  忘掉有多难
    2020-11-28 07:22

    In case also setting the height of the html and the body to 100% makes everything messier for you as it did for me, the following worked for me:

    height: calc(100vh - 33rem)
    

    The - 33rem is the height of the elements coming after the one we want to take full height, i.e., 100vh. By subtracting the height, we will make sure there is no overflow and it will always be responsive (assuming we are working with rem instead of px).

提交回复
热议问题