can´t get links to go horizontally

Discussion in 'HTML & Website Design' started by HDaddy, May 21, 2007.

  1. #1
    Hi!

    I´m testin those imagebased links that i´ve questioned earlier. I´m not able to get those links to go horizontally. I don´t know why. I thought maybe u could help me. here´s a link to a sample.

    http://koti.mbnet.fi/thinner/testi/

    here´s the css

    
    body {background: #fff;}
    .navi {	
    	
    	background: #000;
    	margin: 0 auto;
    	width: 500px;
    	height: 25px;
    }
    
    /*Links*/
    
    a.link1 {
    	display: block;
    	background: url(moo/link1.gif) no-repeat;
    	
    }
    	a.link1:hover {
    		background: url(mov/link1o.gif) no-repeat;
    		
    }	
    a.link2 {
    	display: block;
    	background: url(moo/link2.gif) no-repeat;
    	
    	
    }
    a.link2:hover {
    		background: url(mov/link2o.gif) no-repeat;
    		
    		
    }	
    a.link3 {
    	display: block;
    	background: url(moo/link3.gif) no-repeat;
    }
    a.link3:hover {
    	background: url(mov/link3o.gif) no-repeat;
    		
    }	
    
    
    Code (markup):
    and if u look closely the pics u can see blue line in each one the links. Do u think i did something wrong in slicing?

    i would be glad if could help me!

    thanks in advance!

    HDaddy
     
    HDaddy, May 21, 2007 IP
  2. Katy

    Katy Moderator Staff

    Messages:
    3,490
    Likes Received:
    513
    Best Answers:
    7
    Trophy Points:
    355
    #2
    Just add float: left; to your CSS.
     
    Katy, May 21, 2007 IP
  3. HDaddy

    HDaddy Active Member

    Messages:
    287
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    60
    #3
    that didn´t work..any other ideas?
     
    HDaddy, May 21, 2007 IP
  4. yasha78

    yasha78 Active Member

    Messages:
    43
    Likes Received:
    1
    Best Answers:
    1
    Trophy Points:
    53
    #4
    Uhm... why don't you use a simple html table?
     
    yasha78, May 21, 2007 IP
  5. tnd

    tnd Well-Known Member

    Messages:
    92
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    123
    #5
    I think use Unordered Lists <ul> can solve this problem and set CSS style Use display: inline; and list-style-type: none; to make a basic horizontal list.

    See this example:

    
    HTML
    <div id="navcontainer">
    <ul id="navlist">
    <li id="active"><a href="#" id="current">Item one</a></li>
    <li><a href="#">Item two</a></li>
    <li><a href="#">Item three</a></li>
    <li><a href="#">Item four</a></li>
    <li><a href="#">Item five</a></li>
    </ul>
    </div>
    
    CSS
    #navlist li
    {
    display: inline;
    list-style-type: none;
    padding-right: 20px;
    }
    
    Code (markup):
     
    tnd, May 21, 2007 IP