Page Widget How to - Align footer to the page bottom








Question

We would like to know how to Align footer to the page bottom.

Answer


<html>
<head>
<style>
#container {<!--from  w  w  w . j a  v  a  2s  . c  om-->
  position: relative;
  height: 96%;
  min-height: 600px;
  width: 100%;
  min-width: 975px;
  max-width: 1300px;
  margin: 0 auto;
  z-index: 2;
}

#centerHolder {
  float: left;
  margin-left: 245px;
  width: 10%;
  z-index: 1000;
}

#footer {
  /*border:1px solid green;*/
  margin: 0;
  padding-top: 5px;
  position: relative;
  text-align: center;
  z-index: 1;
}
</style>
</head>
<body>
  <div id="container">
    <div id="centerHolder">Here's some text</div>
  </div>
  <p id="footer">
    Copyright 2015 java2s.com Corporation <a class="link" href="#">Contact Us</a>
  </p>
</body>
</html>

The code above is rendered as follows: