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

后端 未结 5 710
小蘑菇
小蘑菇 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:28

    div.screenMask
    {
        position: absolute;
        left: 0px;
        top: 0px;
        right: 0px;
        bottom: 0px;
        z-index: 1000;
        background-color: #000000;
        opacity: 0.7;
        filter: alpha(opacity=70);
        visibility: hidden;
    }
    

    By setting all of top, bottom, left, and right, the height and width are automatically calculated. If screenMask is a direct child of the element and the standard box model is in effect (i.e. quirks mode has not been triggered), this will cover the entire page.

提交回复
热议问题