The Problem: My popup div dosent take up the entire screen.
Fiddle replicating the problem.
I have an email pop up that has a background div to "grey out" the website when it triggers. The problem is that this div only takes up the visible screen and if a user decides to scroll they can see the rest of the "non-greyed out" site.
My question: How can you force a div to take up the entire width and height of the browser window?
I made a fiddle to simplify and reproduce the problem ( please see above ), and I have also included its code below. I'm trying to make the div take the entire screen through absolute positioning (as many other SO answers have suggested), but this tactic fails when there are other divs present. Any idea how to get around it?
html:
<body>
<div class="other_things"></div>
<div id="full"></div>
<div class="other_things"></div>
<div class="other_things"></div>
<div class="other_things"></div>
</body>
CSS:
#full {
background: rgba(0,0,0,.6);
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
.other_things {width:40em; height: 50em;}
Similar Questions and their answers: