You are here

17 April 2011

Center floating divs or menus or any kind of floats using css.

Source code viewer
  1. <style type="text/css">
  2. #menu-wrapper{position:relative;left:-50%;float:right}
  3. ul{position:relative;left:50%}
  4. li{display:block;float:left}
  5. </style>
  6. <div id="menu-wrapper">
  7. <ul>
  8. <li>Link 1</li>
  9. <li>Link 2</li>
  10. <li>Link 3</li>
  11. </ul>
  12. <div style="clear:both"></div>
  13. </div>
Programming Language: CSS