Extend div to bottom of page (only HTML and CSS)

前端 未结 2 1799
情歌与酒
情歌与酒 2020-12-23 17:37

Its a very simple problem but I can\'t seem to find a suitable solution online. I want to have a list of elements in natural flow with the last element extended to the botto

2条回答
  •  清歌不尽
    2020-12-23 17:39

    Set the height of html, body to 100%. Then, you can set the last

    's height to 100% and it will be as tall as the window. Since you probably don't want scrolling, you can set overflow: hidden on the html, body as well.

    http://jsfiddle.net/GKbzx/

提交回复
热议问题