Position of Div within container - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Position

Description

Position of Div within container

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  ww  . j  a  va  2 s .  c  om-->
   margin:0;
   padding:0;
}

html {
   height:100%;
   width:100%;
}

body {
   font-family:Arial,Helvetica,sans-serif;
   font-size:76%;
   line-height:2.6em;
   height:100%;
   width:100%;
}

#wrapper {
   height:100%;
   width:100%;
   border:solid Chartreuse;
   position:relative;
   visibility:visible;
   z-index:2;
}

#container {
   border:dotted yellow;
   z-index:3;
   width:100%;
}

#header {
   background-color:blue;
   clear:both;
   height:100px;
   width:100%;
}

#contain {
   background-color:pink;
   min-width:1121px;
   width:100%;
}

#cnlft {
   background-color:OrangeRed;
   padding:11px;
   height:auto;
   width:181px;
   float:left;
}

#cncnt {
   background-color:grey;
   padding:11px;
   width:701px;
   height:auto;
   float:left;
}

#cnrht {
   background-color:BlueViolet;
   padding:11px;
   float:left;
   width:181px;
   height:auto;
}

.clr {
   clear:both;
}
</style> 
 </head> 
 <body> 
  <div id="wrapper"> 
   <div id="container"> 
    <div id="header">
      Lorem ipsum dolor sit amet, consectet 
    </div> 
    <div id="contain"> 
     <div id="cnlft">
       Lorem ipsum dolor sit amet, consectet 
     </div> 
     <div id="cncnt">
       Lorem ipsum dolor sit amet, consect 
     </div> 
     <div id="cnrht">
       Lorem ipsum dolor sit amet, consect 
     </div> 
     <div class="clr"></div> 
    </div> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials