Page Widget How to - Create Left Sidebar








Question

We would like to know how to create Left Sidebar.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
.fixed-sidebar {<!--from   w ww  .j a  v a 2s . c om-->
  top: 0px;
  left: 0px;
  width: 12%;
  color: white;
  background: #CCC;
  height: 100%;
  position: absolute;
}

.offset-content {
  border: solid red 0px;
  width: 68%;
  height: 100%;
  background: orange;
  color: black;
  margin-left: 300px;
  float: right;
}
</style>
</head>
<body>
  <div class="fixed-sidebar">Hello</div>
  <div class="offset-content">Hello</div>
</body>
</html>

The code above is rendered as follows: