HTML Form How to - Assign width and height property as of screen








Question

We would like to know how to assign width and height property as of screen.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
#div0 {<!--from   w  w w  .  j  av a2s  . c o  m-->
  height: 500px;
  background-color: blue;
}

#div1 {
  height: 100%;
  background-color: red;
  position: absolute;
}
</style>
</head>
<body>
  <div id="div0">
    <div id="div1">content</div>
  </div>
</body>
</html>

The code above is rendered as follows: