We Recommend

CSS: The Definitive Guide CSS: The Definitive Guide
Provides you with a comprehensive guide to CSS implementation, along with a thorough review of all aspects of CSS 2.1. Updated to cover Internet Explorer 7, Microsoft's vastly improved browser, this new edition includes content on positioning, text wrapping (nowrap), lists and generated content, table layout, user interface, paged media, and more.


Posted By

indianocean on 06/06/07


Tagged

css alignment floating


Versions (?)


Who likes this?

2 people have marked this snippet as a favorite

basicmagic
vali29


Align Elements on left and right side


Published in: CSS 


  1. .containingbox{
  2. margin-left: auto;
  3. margin-right: auto;
  4. width: 400px;
  5. height: 200px;
  6. border: 1px solid #000;
  7. }
  8. .floatright{
  9. float: right;
  10. }
  11. .floatleft{
  12. float: left;
  13. }
  14.  
  15. <div class="containingbox">
  16. <div class="floatleft">left</div>
  17. <div class="floatright">right</div>
  18. </div>

Report this snippet 

You need to login to post a comment.