Set background on div and float its children - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Float

Description

Set background on div and float its children

Demo Code

ResultView the demo in separate window

<html>
 <head></head> 
 <body> 
  <div style="background: #CCC; width:100%; height:50px;position:relative;"> 
   <div style="float:right;">
     right 
   </div> <!--from  w ww  . ja v a  2  s . com-->
   <div style="float:left;">
     left 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials