Not signed in (Sign In)

SkillShare - A place to discuss Web Standards and Web Design topics

Categories

Vanilla 1.1.5a is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorastatic
    • CommentTimeDec 28th 2005
     permalink
    I got my navgation bar to work but it looks odd because there are not enough links to fill the div.

    I tried making a blank black image 700px wide and setting it as the wrapper bg, but it didn't help.

    Is there a way I can center my navigation bar?
    I tried div-align: center; but I guess that doesn't apply in css?

    what I have so far http://astatichosting.5gigs.com/test/news.php
    •  
      CommentAuthorJohnRiv
    • CommentTimeDec 28th 2005 edited
     permalink

    To center something horizontally, you set its left and right margins to "auto". If you want it to work in IE5.x, you need to use "text-align: center" on the containing element and then apply "text-align: left" to the element you are centering so its text does not center (unless you want it to be centered). So change your CSS to this:


    #navigation {
    height: 20px;
    margin: 0;
    padding: 0;
    position: relative;
    text-align: center;
    }

    #navigation ul {
    width: 304px;
    height: 20px;
    background-image: url(img/nav_bg.gif);
    list-style: none;
    padding: 0;
    margin: 0 auto;
    text-align: left;
    }

    • CommentAuthorastatic
    • CommentTimeDec 28th 2005
     permalink
    thank you!
    But now my bottom border is not visible in explorer?
    (I reuploaded the style sheet so you can see it )
    • CommentAuthorastatic
    • CommentTimeDec 28th 2005
     permalink
    Nevermind I fixed it, sort of.
    I just took the bottom border off the container and added it to my footer.
    •  
      CommentAuthorJohnRiv
    • CommentTimeDec 28th 2005
     permalink
    is appears the -5px top margin on #wrapper is causing the problem. Although negative margins are valid, they sometimes cause rendering issues in IE. I'd try to adjust your layout so you don't need the -5px top margin. Setting it to "0" and then subtracting 5px from the #top div should do the trick I believe, although you may need to adjust a few other heights/margins/paddings.
Add your comments
    Username Password
  • Format comments as (Help)