Results 1 to 7 of 7

Thread: How to center this CSS

  1. #1
    Join Date
    Aug 2008
    Location
    Smiths, AL
    Posts
    164
    Thanks
    30
    Thanked 5 Times in 5 Posts

    Default How to center this CSS

    I have decided to change my CSS from an older type to this new version of frustration...

    Can someone help me center the nav bar on my page?
    www.josephsalmi.com

    right now I have this code to put it where I want it but that is only on this screen. I would like to center the navbar on every computer screen.

    .mynavbarmenu{
    font: bold 12px Verdana;
    border-bottom: 1px solid black;
    position: absolute;
    z-index:100;
    padding-left: 331px; /*offset of tabs relative to browser left edge*/
    }

  2. #2
    Join Date
    Aug 2008
    Location
    Smiths, AL
    Posts
    164
    Thanks
    30
    Thanked 5 Times in 5 Posts

    Exclamation

    Just thought I might add that I am using the jQuery Multi Level CSS Menu #1 code from here:
    http://www.dynamicdrive.com/style/cs...rizontal_blue/

  3. #3
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Set a width and then use margin:auto;

  4. #4
    Join Date
    Aug 2008
    Location
    Smiths, AL
    Posts
    164
    Thanks
    30
    Thanked 5 Times in 5 Posts

    Default

    Okay this is what I have now and nothing happend

    Code:
    .mynavbarmenu{
    font: bold 12px Verdana;
    border-bottom: 1px solid black;
    position: absolute;
    width: 610px;
    margin: auto;
    } 
    
    .mynavbarmenu ul{
    margin: 0;
    padding: 0;
    list-style-type: none;
    }
    
    /*Top level list items*/
    .mynavbarmenu ul li{
    position: relative; 
    display: inline;
    float: left;
    }

  5. #5
    Join Date
    Jan 2006
    Location
    Ft. Smith, AR
    Posts
    795
    Thanks
    57
    Thanked 129 Times in 116 Posts

    Default

    use position RELATIVE and margin 0 auto...

    like this:

    Code:
    .mynavbarmenu {
    -x-system-font:none;
    border-bottom:1px solid black;
    font-family:Verdana;
    font-size:12px;
    font-size-adjust:none;
    font-stretch:normal;
    font-style:normal;
    font-variant:normal;
    font-weight:bold;
    line-height:normal;
    margin:0 auto;
    position:relative;
    width:610px;
    --------------------------------------------------
    Reviews, Interviews, Tutorials, and STUFF
    --------------------------------------------------
    Home of the SexyBookmarks WordPress plugin

  6. The Following User Says Thank You to TheJoshMan For This Useful Post:

    Dirt_Diver (10-22-2008)

  7. #6
    Join Date
    Aug 2008
    Location
    Smiths, AL
    Posts
    164
    Thanks
    30
    Thanked 5 Times in 5 Posts

    Default

    SWEET!!!!!!!!!!! that works for IE and FF. Awesome fix. Thanks...

  8. #7
    Join Date
    Jan 2006
    Location
    Ft. Smith, AR
    Posts
    795
    Thanks
    57
    Thanked 129 Times in 116 Posts

    Default

    no problem, glad to help
    --------------------------------------------------
    Reviews, Interviews, Tutorials, and STUFF
    --------------------------------------------------
    Home of the SexyBookmarks WordPress plugin

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •