I want to create a div over the body which should take 100% height of the page.
I am defining html and body height is 100%. Also the div height is 100%.
still it's not working for me. Can some one please tell me what is wrong?
below is the code snippet.
Thanks.
I am defining html and body height is 100%. Also the div height is 100%.
still it's not working for me. Can some one please tell me what is wrong?
below is the code snippet.
Thanks.
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<script>
window.onload = pageLoad;
function pageLoad()
{
document.getElementsByTagName("html")[0].style.height = "100%";
document.body.style.height = "100%";
dv = document.createElement('div');
dv.style.position="absolute";
dv.style.top=0;
dv.style.left=0;
dv.style.height="100%";
dv.style.width="100%";
dv.style.backgroundColor="red";
dv.style.filter="alpha(opacity=70)";
dv.style.opacity=.70;
document.body.appendChild(dv);
}
</script>
</HEAD>
<BODY>
test<br><br><br><br><br><br><br>
test<br><br><br><br><br><br><br> test<br><br><br><br><br><br><br> test<br><br><br><br><br><br><br> test<br><br><br><br><br><br><br> test<br><br><br><br><br><br><br> test<br><br><br><br><br><br><br> test<br><br><br><br><br><br><br> test<br><br><br><br><br><br><br> test<br><br><br><br><br><br><br> test<br><br><br><br><br><br><br> test<br><br><br><br><br><br><br> test<br><br><br><br><br><br><br> test<br><br><br><br><br><br><br> test<br><br><br><br><br><br><br> test<br><br><br><br><br><br><br>
</BODY>
</HTML>
Comment