Align Inline Element to the Right - HTML CSS CSS Property

HTML CSS examples for CSS Property:display

Description

Align Inline Element to the Right

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">
.container {<!--from   w w  w .  j  a  v a  2  s  . c  o  m-->
   width:601px;
   border:2px solid Chartreuse;
}

.inlineLeft, .inlineRight {
   display:inline-block;
}

.inlineRight {
   display:inline-block;
   position:absolute;
   right:0;
}
</style> 
 </head> 
 <body> 
  <div class="contailner"> 
   <div class="inlineLeft">
     Item 1 
   </div> 
   <div class="inlineRight">
     Item 2 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials