CSS Layout How to - Attach div to browser bottom








Question

We would like to know how to attach div to browser bottom.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
#textBoxContainer {<!-- w ww .  j  a  va 2 s  . com-->
  height: 30%;
  position: fixed;
  z-index: 99;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #999;
  border: 4px solid #000;
}
</style>
</head>
<body>
  <div id="textBoxContainer"></div>
</body>
</html>

The code above is rendered as follows: