Make last div fill the rest of the screen height - Javascript jQuery

Javascript examples for jQuery:Width Height

Description

Make last div fill the rest of the screen height

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <script type="text/javascript" src="https://code.jquery.com/jquery-1.9.1.js"></script> 
  <script type="text/javascript">
    $(window).load(function(){//from  w w w . ja v a2  s.c  om
$(document).ready(function() {
    var height = $(window).height();
    $('div').css('height', height + 'px');
});
    });

      </script> 
 </head> 
 <body> 
  <div style="background-color: red;"></div> 
  <p>Content below div</p>  
 </body>
</html>

Related Tutorials