Page Widget How to - bottom centering in a header using table cells








Question

We would like to know how to bottom centering in a header using table cells.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
#header {<!--from   w  w  w. ja v a 2s.com-->
  width: 1062px;
  height: 326px;
  background-color: #110000;
  text-align: center;
  display: table-cell;
  vertical-align: bottom;
}

#header .container {
  width: 900px;
  height: 262px;
  background-color: #cccccc;
  color: white;
  display: inline-block;
}
</style>
</head>
<body>
  <div id="header">
    <div class="container">header</div>
  </div>
  <div id="content">
    <div class="container">content</div>
  </div>
  <div id="footer">
    <div class="container">footer</div>
  </div>
</body>
</html>

The code above is rendered as follows: