Box-Sizing to layout - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Layout

Description

Box-Sizing to layout

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">
* {<!--  w  w  w.ja va  2  s  .c o m-->
   margin:0;
}

.container {
   width:100%;
}

#left {
   box-sizing:border-box;
   margin-top:13px;
   float:left;
   border:2px solid Chartreuse;
   width:21%;
}

#right {
   box-sizing:border-box;
   margin-top:13px;
   float:left;
   border:2px solid yellow;
   width:21%;
}

#center {
   box-sizing:border-box;
   margin-top:13px;
   float:left;
   border:2px solid blue;
   width:61%;
}
</style> 
 </head> 
 <body> 
  <div class="container"> 
   <div id="left">
     Lorem 
   </div> 
   <div id="center">
     Lorem ip 
   </div> 
   <div id="right">
     Lorem i 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials