Create 2 column layout floating left and right with 1px border - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:2 Column

Description

Create 2 column layout floating left and right with 1px border

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">
.wrap {<!--from   w w w. j  av a2  s.com-->
   width:100%;
}

.floatleft {
   float:left;
   width:81%;
   background-color:Chartreuse;
   height:401px;
   border-right:2px solid yellow;
   box-sizing:border-box;
}

.floatright {
   float:right;
   background-color:blue;
   height:401px;
   width:21%;
}
</style> 
 </head> 
 <body> 
  <div class="wrap"> 
   <div class="floatleft">
     left 
   </div> 
   <div class="floatright">
     right 
   </div> 
   <div style="clear: both;"> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials