How to make a div 100% of page (not screen) height?

后端 未结 5 699
小蘑菇
小蘑菇 2020-12-08 03:42

I\'m trying to use CSS to create a \'greyed out\' effect on my page while a loading box is displayed in the foreground while the application is working. I\'ve done this by c

5条回答
  •  情歌与酒
    2020-12-08 04:32

    If you are using jQuery to set the height before the popup I'm guessing it is OK to add some more javascript :)

    You can set the height of the div to the scrollHeight of document.body - this way it should cover the whole of the body. You do need to add some extra trickery to make sure it keeps covering the body in case something underneath decides to grow though.

提交回复
热议问题