How to Evenly Space the Navigation Links?

Discussion in 'HTML & Website Design' started by m1ndless, Jul 14, 2010.

  1. #1
    I am not sure if this is the appropriate forum or not, but I am having trouble with my code and spacing out my navigation links evenly.


    Here's the HTML:
    <ul id="nav">
    				
    						<li><a href="#">Link</a></li>
    						
    						<li><a href="#">Link</a></li>
    						
    						<li><a href="#">Link</a></li>
    						
    						<li><a href="#">Link</a></li>
    						
    						<li><a href="#">Link</a></li>
    						
    						<li><a href="#">Link</a></li>
    				
    				</ul>
    Code (markup):
    Here's the CSS:
    #nav {
    	margin:0 0 0 0;
    }
    
    #nav li {
    	list-style:none;
    	display:inline;
    	padding:7px 0;
    }
    
    #nav li a {
    	padding:7px;
    	color:#eee;
    	text-decoration:none;
    }
    
    #nav li a:hover {
    	background:#222;
    	color:#fff;
    }
    
    Code (markup):
    What do I need to change? Right now they all float left.
     
    m1ndless, Jul 14, 2010 IP
  2. secci

    secci Peon

    Messages:
    80
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    display:inline; may be causing them to all float left if thats the problem?
     
    secci, Jul 14, 2010 IP
  3. m1ndless

    m1ndless Peon

    Messages:
    1,112
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #3
    If I remove that the links disappear.
     
    m1ndless, Jul 15, 2010 IP
  4. m1ndless

    m1ndless Peon

    Messages:
    1,112
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #4
    bump, any advice?
     
    m1ndless, Jul 17, 2010 IP
  5. SamPeterson

    SamPeterson Peon

    Messages:
    13
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    For the A elements, margin:0; padding:0; ?
     
    SamPeterson, Jul 17, 2010 IP
  6. secci

    secci Peon

    Messages:
    80
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    try display: block; ?
     
    secci, Jul 17, 2010 IP