Layout text to left and right in its container - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Text

Description

Layout text to left and right in its 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">

#grey_box {<!--   w ww . j a  v  a  2  s  .c o m-->
   height: 80px;
   background: #f4f4f4;
   width: 900px;
   margin: 0 0 20px 20px;
}
.text {
   float: left;
   width: 450px;
}
.buttons {
   float: right;
   margin-right: 20px;
   width: 350px;
   padding:20px;
   text-align:right;
}


      </style> 
 </head> 
 <body> 
  <div id="grey_box"> 
   <p class="text">some text</p> 
   <div class="buttons"> 
    <a class="button1">button 1</a> 
    <a class="button2">button 2</a> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials