CSS Elements Position two div to top with different height - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Position

Description

CSS Elements Position two div to top with different height

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
 </head> <!--  w  w w.  j  av a2s . c  o m-->
 <body> 
  <div style="width:300px"> 
   <div style="width:100px; display:inline-block; background-color:green; float:left">
     Lorem ipsum dol 
   </div> 
   <div style="display:inline-block; background-color:yellow; float: right; width: 200px;">
     Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcorper molestie lacus sed fermentum. A 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials