HTML Element Style How to - Make Absolute Div Fill Remainder of Window








Question

We would like to know how to make Absolute Div Fill Remainder of Window.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
#tab1 {<!--  w w  w . j a  va 2 s.  c o  m-->
  position: absolute; bottom; 0 px;
  right: 0px;
  width: 50px;
  height: 20px;
  background-color: #EEE;
}

#tab2 {
  position: absolute; bottom; 0 px;
  right: 50px;
  width: 50px;
  height: 20px;
  background-color: #AAA;
}

#help {
  position: absolute;
  left: 0; bottom; 0 px;
  right: 100px;
  height: 20px;
  background-color: #CCC;
}
</style>
</head>
<body>
  <div id="tab1">tab1</div>
  <div id="tab2">tab2</div>
  <div id="help">help</div>
</body>
</html>

The code above is rendered as follows: