Setting 100% height on an absolutely positioned element when the content expands past the window size

前端 未结 3 901
滥情空心
滥情空心 2021-02-15 04:46

So after reading Stack Overflow and the web, I\'ve gathered that there are two main tricks to achieving 100% height:

  1. Set height:100% on both the HTML and BODY
3条回答
  •  -上瘾入骨i
    2021-02-15 05:49

    I would use javascript to assign the height and width equal to document's height and window's width respectively; I've modified your jsfiddle to demonstrate it here:

    http://jsfiddle.net/9FEne/1/

提交回复
热议问题