Reputation: 42444
I want to create an overlay that I will use behind a popup. But when the page is scrolled down the overlay is no more there? I can use javascript to get the height of page's content and then can apply same height to overlay but is there any css based solution?
#overlay{
width: 100%;
height: 100%;
position: absolute;
left: 0px;
top: 0px;
background-color:#000;
opacity: .75
}
Upvotes: 0
Views: 689
Reputation: 461
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
position: relative;
Try that, i'm not sure if it works on anything but backgrounds but its worth a shot!
Upvotes: 0