DIVs position with width setting - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Position

Description

DIVs position with width setting

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 {<!-- w w  w.  j a  v a2  s .c  o m-->
   width:201px;
}

#as {
   width:201px;
   clear:both;
}

#bs {
   width:100px;
   float:left;
}

#cs {
   width:100px;
   float:right;
}

#ds {
   clear:both;
}
</style> 
 </head> 
 <body> 
  <div id="wrap"> 
   <div id="as">
     Lorem ipsum dolor sit amet, consectetur adipiscin 
   </div> 
   <div id="bs">
     Lorem ipsum dolor sit amet, consectetur adipiscin 
   </div> 
   <div id="cs">
     Lorem ipsum dolor sit amet, consectetur adipiscin 
   </div> 
   <div id="ds">
     Lorem ipsum dolor sit amet, consectetur adipiscin 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials