CSS Layout How to - Divide content area to equal-width columns








Question

We would like to know how to divide content area to equal-width columns.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
html {<!--   w ww  .j ava  2 s .  c  om-->
  height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  padding: 0;
}

#wrapper {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  background: cyan;
}
</style>
</head>
<body>
  <div id="wrapper"></div>
</body>
</html>

The code above is rendered as follows: