Reputation: 2282
Is there any way to make a DIV fullscreen regardless where it is positioned in the HTML page? In some pages I want a DIV to overlay everything behind it, but if the body is only half the screen, my DIV also becomes half the screen instead of fullscreen.
I use this CSS:
.MainOverlayDIV{
width:100%;
height:100%;
z-index:90;
position:fixed;
top:0%;
left:0%;
background-color:#F1F2F3;
opacity:0.9;
display:none;
}
Upvotes: 0
Views: 2664
Reputation: 1422
.MainOverlayDIV{
top: 0;
left: 0;
right: 0;
bottom: 0;
position: fixed;
z-index: 100500;
}
Upvotes: 3