Skip to content

Instantly share code, notes, and snippets.

@fazlurr
Created March 11, 2014 01:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fazlurr/8d1bc73b766fd89840f2 to your computer and use it in GitHub Desktop.
Save fazlurr/8d1bc73b766fd89840f2 to your computer and use it in GitHub Desktop.
A quick, non-elegant but working standalone solution with inline CSS and no jQuery requirements. AFAIK it works from IE9 too. from : http://stackoverflow.com/questions/11868474/how-to-make-the-web-page-height-to-fit-screen-height
<body style="overflow:hidden; margin:0">
<form id="form1" runat="server">
<div id="main" style="background-color:red">
<div id="content">
</div>
<div id="footer">
</div>
</div>
</form>
<script language="javascript">
function autoResizeDiv()
{
document.getElementById('main').style.height = window.innerHeight +'px';
}
window.onresize = autoResizeDiv;
autoResizeDiv();
</script>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment