Skip to content

Instantly share code, notes, and snippets.

@patrickmooney
Created April 26, 2013 13:48
Show Gist options
  • Save patrickmooney/5467495 to your computer and use it in GitHub Desktop.
Save patrickmooney/5467495 to your computer and use it in GitHub Desktop.
Full screen alpha black out - handy for layering. The overlay div will be 100% width and height, fixed to the top left. It uses a height of 2000px due to the screen not know where to draw the div when touch scrolling on mobile devices. Tested on iOS and Android.
<!doctype html>
<html>
<head>
<title>Overlay Test</title>
<style>
div.overlay{
position:fixed;
top:0;
left:0;
width:100%;
height:2000px;
background-color: black;
z-index:100;
opacity:0.7;
}
</style>
</head>
<body>
<div>
Below
</div>
<div class="overlay">
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment