Making a simple layout with a sidebar in HTML & CSS - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Layout

Description

Making a simple layout with a sidebar in HTML & CSS

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">
body {<!--   w  ww . j  a  v a  2  s.  co m-->
   margin:0;
   padding:0;
}

.sidebar,.content {
   background:Chartreuse;
   color:yellow;
   height:501px;
   border-radius:5px;
   margin:21px;
   border:2px solid blue;
}

.sidebar {
   width:301px;
   float:left;
   position:absolute;
}

.content {
   width:631px;
}
</style> 
 </head> 
 <body> 
  <div class="sidebar"> 
  </div> 
  <div class="content"> 
  </div>  
 </body>
</html>

Related Tutorials