Skip navigation
Currently Being Moderated

Trying To Center navBar

Feb 13, 2012 3:21 AM

Hi...

 

I've been pulling my hair out trying to get a single navbar to sit nicely in the middle of the header div.  I've done it before but for some reason it seems like everytime I try I'm using a different method to get the desired effect.

 

I don't know if this is too general of a question or not but is there some slick way to position a navbar within a header?  Float doesn't seem to do the trick so what does?

 

Thanks!

 
Replies
  • Currently Being Moderated
    Feb 13, 2012 10:57 AM   in reply to Prodigy9

    It depends on your layout and the menu you're using.

     

    Centering Spry Horizontal Menus

    http://foundationphp.com/tutorials/sprymenu/centering.php

     

    Centering Pages in DW

    http://forums.adobe.com/thread/454036

     

    Centering Web Pages and Other Elements with CSS

    http://cookbooks.adobe.com/post_Centering_web_pages_and_other_elements _with_CSS-16640.html

     

     

    Nancy O.

    Alt-Web Design & Publishing

    Web | Graphics | Print | Media  Specialists 

    http://alt-web.com/

    http://twitter.com/altweb

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 14, 2012 10:34 AM   in reply to Prodigy9

    It's my understanding judging by what I've seen is I need to set the width as far as the page is wide (ex. width: 960px)...  And then the margins at auto for right and left so the browser will do the calculating...  Is this correct?

    Yes.  And you also need a valid document type declaration in the HTML.  

     

    Exceptions:

    • position:absolute
    • position:fixed
    • floats

    which are removed from the normal document flow.   For better answers, can you post a link to your test page?

     

     

    Nancy O.

    Alt-Web Design & Publishing

    Web | Graphics | Print | Media  Specialists 

    http://alt-web.com/

    http://twitter.com/altweb

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points