Return to Snippet

Revision: 9104
at October 21, 2008 11:55 by kanirasta


Initial Code
1.
      .navwrap{
   2.
      float:left;
   3.
      position:relative;
   4.
      left:50%;
   5.
      }
   6.
      .navwrap ul{
   7.
      position:relative;
   8.
      left:-50%;
   9.
      }

Initial URL
http://www.search-this.com/2007/09/19/when-is-a-float-not-a-float/

Initial Description
Add two containers to the element to be centered.

This is also needed for IE6:

   1.
      <!--[if>-->
   2.
      .navwrap ul{float:left;}
   3.
      <![endif]-->

Initial Title
Horizontally centering elements without width

Initial Tags
css, xhtml, layout

Initial Language
CSS