当前位置:网站首页>How to make div 100% page (not screen) height- How to make a div 100% of page (not screen) height?

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

2022-06-12 02:20:00 Superior virtue and weak water

problem :

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'm trying to use CSS Create a... On my page “ gray ” effect , At the same time, the loading box is displayed in the foreground when the application is running .I've done this by creating a 100% height/width, translucent black div which has its visibility toggled on/off via javascript. I created 100% Height / Width , Translucent black div To achieve this , It passes through javascript open / Turn off its visibility .I thought this would be simple enough; I think it's very simple ;however, when the page content expands to the point that the screen scrolls, scrolling to the foot of the page reveals a portion which is not greyed out. however , When the page content expands to the point where the screen scrolls , Scrolling to the bottom of the page displays a section that is not grayed out .In other words, the 100% in the div's height seems to be applying to the browser viewport size, not the actual page size. let me put it another way ,div High 100% Seems to work for browser viewport sizes , Instead of the actual page size .How can I make the div expand to cover the whole of the page's content? How to make div Expand to cover the entire page ?I've tried using JQuery .css('height', '100%') before toggling it's visibility on but this doesn't change anything. I've tried to use JQuery .css('height','100%') Before switching its visibility , But that hasn't changed anything .

This is the CSS of the div in question: There's a problem div Of CSS:

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

Thanks. thank you .


Solution :

Reference resources : https://stackoom.com/en/question/4D5J
原网站

版权声明
本文为[Superior virtue and weak water]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/03/202203011151333681.html