If you have markup as indicated below, then you have invalid markup, which will cause problems.

A UL element can't contain a div - it has to contain li's, which in turn can contain a div. I would expect that structure to fail.

Removing the div immediately after the UL, will clean things up.

Now, for centering, you may have to wrap the whole thing in a separate div and then use the CSS tricks to center THAT div - auto margins, text-align, etc.

er. just read your request a little more.  Try this:

<div class="navbar-wrapper">
  <div class="centerMe">
    <ul class="sf-menu sf-navbar">
      <li>...</li>
      <li>...</li>
      <li>...</li>
    </ul>
  </div>
</div>

Apply the centering tricks to div.centerMe.

Disclaimer - I just pulled an all nighter, so I need to freely suggest that my advice at this point may be questionable... :)

Shawn

rupak mandal wrote:
Put the ul inside a div. I think it will work



On Tue, Oct 20, 2009 at 9:05 AM, Shawn <shallway...@gmail.com <mailto:shallway...@gmail.com>> wrote:


    I'm using a navbar with superfish. I simply put my menu list inside a
    wrapper so the markup looks like this:

    <div class="navbar-wrapper>
    <ul class="sf-menu sf-navbar">

<div>

    <li>...</li>
    <li>...</li>
    <li>...</li>
    </ul>

</div>

    </div>

    now I want to make the navbar-wrapper 100% of width and the navbar to
    be centered in it, I thought it should be simple just do the following
    css trick

    div.navbar-wrapper{ width:100%; text-align:center; }

    However this didn't work, the supersish menu just didn't get
    centered.

    How can I fix this? Thanks.


Reply via email to