Hi, im trying to make a 50% opacity div appear all over the site, i gave it position absolute and width, height of 100%. but its still appears only parts of the site, if you scroll down, its not wrapping the rest of the site.
what can i do?
thanks!
Hi, im trying to make a 50% opacity div appear all over the site, i gave it position absolute and width, height of 100%. but its still appears only parts of the site, if you scroll down, its not wrapping the rest of the site.
what can i do?
thanks!
Use position: fixed; instead of position: absolute;:
<div style="width: 100%; height: 100%; margin: 0em;
left: 0em; top: 0em; background: black;
position: fixed;">Loading ...</div>
This works too:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Test</title>
<style type="text/css">
#big {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
background: #000;
}
</style>
</head>
<body>
<div id="big"></id>
</body>
</html>
Setting top and bottom should do the trick (it also works with position: fixed).