CSS Layout How to - Create 3 row and single column layout








Question

We would like to know how to create 3 row and single column layout.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
body {<!--  ww w . ja  v  a  2s  . c  o  m-->
  margin: 0;
  padding: 0;
}

div#header {
  width: 100%;
  height: 65px;
  position: fixed;
  z-index: 100;
  background-color: #F00;
}

div#footer {
  width: 100%;
  height: 65px;
  position: fixed;
  bottom: 0;
  background-color: #06F;
}

div#content {
  background-color: #111;
  width: 100%;
  height: 100%;
  position: absolute;
}
</style>
</head>
<body>
  <div id="container">
    <div id="header"></div>
    <div id="content"></div>
    <div id="footer"></div>
  </div>
</body>
</html>

The code above is rendered as follows: