Creating a Page with Sidebar and Main Content Area using HTML & CSS

A webpage with fluid sidebar and main content area is created by setting the size of html and body to 100%.

The following example illustrates this.


 Live Demo

<!DOCTYPE html>
html,body {
   height: 100%;
   color: white;
   font-size: 2em;
   line-height: 200px;
#parent {
   display: table;
   width: 100%;
   height: 100%;
#side {
   display: table-cell;
   background-color: turquoise;
   width: 20%;
   vertical-align: top;
   box-shadow: inset 0 0 10px black;
#main {
   display: table-cell;
   width: 80%;
   background: url(" b50a1d80cfe6?crop=entropy&cs=tinysrgb&fit=crop&fm=jpg&h=800&ixlib=rb1.2.1&q=80&w=600");
<div id="parent">
<div id="side">Side</div>
<div id="main">Main</div>


This will produce the following result −