CSS Centering Question

Discussion in 'CSS' started by Manny819, Apr 6, 2008.

  1. #1
    Hi great forum you have here. :)

    I have a question about centering my navbar. Is there a way to center the links on the subnavbar? I only have three links showing and I'd like to center all the links on the bar rather than have it aligned to the left.

    What should I modify? I tried different things, but nothing has worked thus far.

    Thanks in advanced for any help!
     
    Manny819, Apr 6, 2008 IP
  2. Alex Fraiser

    Alex Fraiser Banned

    Messages:
    75
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Try adding "text-align: center" to it.
     
    Alex Fraiser, Apr 6, 2008 IP
  3. Manny819

    Manny819 Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Where exactly would I put it?
     
    Manny819, Apr 6, 2008 IP
  4. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #4
    If you mean centered within the a's, then here:
    #subnav a {
    background: #EEEEEE url(images/blue.gif);
    color: #333333;
    display: block;
    font-weight: bold;
    margin: 0px 20px 0px 0px;
    padding: 6px 10px 5px 10px;
    }
    stick it in there. BUt I'm not sure what exactly the effect is you're looking for. Text-align: center will center the text (horizontally, not vertically) within the box it's sitting in (which is an "a" in this case).
     
    Stomme poes, Apr 8, 2008 IP