Posted By

kossmoss on 06/10/08


Tagged

css center


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

romanos


Centered block with unknown width


 / Published in: HTML
 

URL: http://trifler.ru/blog/post_1212599291.html

Applications: 1. Centered block with unknown width 2. Simple block which can have float style (f.e. horizontal menu)

  1. CSS:
  2.  
  3. .menucenter {
  4. background:#e6eaff;
  5. border:#0dd 1px solid;
  6. margin:10px;
  7. height:30px;
  8. }
  9. .centermenu {float:left;position:relative;left:50%;}
  10. .cenmenu {position:relative;left:-50%;}
  11. *html .cenmenu {float:left;}
  12.  
  13. HTML:
  14.  
  15. <div class="menucenter">
  16. <div class="centermenu">
  17. <div class="cenmenu">
  18.  
  19. Menu (container) with float style
  20.  
  21. </div>
  22. </div>
  23. </div>

Report this snippet  

You need to login to post a comment.