Page Widget How to - Make Html layout with header and left menu of 100% height








Question

We would like to know how to make Html layout with header and left menu of 100% height.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
#content-wrapper {<!--from w  ww.  jav  a  2  s.  c  om-->
  width: 100%;
  background: blue;
}

#header {
  background: black;
  color: white;
  height: 50px;
}

#menu {
  float: left;
  width: 200px;
  color: white;
  height: 100%;
}

#content {
  margin-left: 200px;
  background: green;
  color: white;
  height: 100%;
  border-left: 5px solid red;
}
</style>
</head>
<body>
<html>
<body>
  <div id="header">header</div>
  <div id="content-wrapper">
    <div id="menu">menu</div>
    <div id="content">
      content <br /> content <br /> content <br /> content <br />
      content <br /> content <br /> content <br /> content <br />
      content <br /> content <br /> content <br /> content <br />
      content <br /> content <br /> content <br /> content <br />
      content <br /> content <br /> content <br /> content <br />
      content <br /> content <br /> content <br /> content <br />
      content <br /> content <br /> content <br /> content <br />
      content <br /> content <br /> content <br /> content <br />
      content <br /> content <br /> content <br /> content <br />
      content <br /> content <br /> content <br /> content <br />
      content <br /> content <br /> content <br /> content <br />
      content <br /> content <br />
    </div>
  </div>
</body>
</html>
</body>
</html>

The code above is rendered as follows: