JOIN DEVPPL

It looks like you are new here. If you want to get involved, click on Join below!



Making a div touch the bottom of the screen


K

keyboard_arrow_up
0
keyboard_arrow_down


First Post Mark as Spam kdjuiopo
Posts: 90 - Registered: 2011-06-30 20:32:13

Hi

I've been web developing for a while but have never seemed to be able to work this out.. Does anyone know how to get a div to be the full height of the users screen as a default. I've tried setting the body to height:100% and then setting the div height to 100% but it's not happy.

I also thought of adding a min-height but that would mean unnecessary scroll on certain screens.

Any help much appreciated




R

keyboard_arrow_up
0
keyboard_arrow_down


Reply #1 Mark as Spam rajmv
Posts: 103 - Registered: 2011-07-14 02:22:09

<html>
<head>
<script type="text/javascript"><!--
window.onresize = function () {
var d = document.getElementById ('wholescreen');
d.style.height = window.innerHeight + 'px';
};

function startApp() {
window.onresize();
}
--></script>
</head>
<body onload="startApp();">
<div id="wholescreen" style="position:absolute;"> </div>
</body>
</html>






JOIN DEVPPL

It looks like you are new here. If you want to get involved, click on Join below!




MENU
Advertising