CSS tabs problem

Discussion in 'CSS' started by cbn81, Mar 17, 2008.

  1. #1
    Hi all!
    I have a site where I would like to add a tab menu on the top. I used the folliwing CSS code:

    ul.tabs { border:1px solid #194367; height: 20px; width: 520px; margin: 0; padding: 0; background:#C0D9DE; overflow:hidden; }
    ul.tabs li { float: left; background-image: url(tab.gif); display:inline; width: 82px; height: 20px; margin: 0px; padding: 0px; text-align: right; }

    but when I create 3 tabs into the ul tag (using li) there is a space between them. I would like to remove this, so tabs will be close to each other. is it due to the fact that li tags try to fill all the space inside the ul?
    Any help to solve this would be appreciated.
     
    cbn81, Mar 17, 2008 IP
  2. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Without seeing your page, the best I can tell you is that the space you're seeing is probably the default styling being applied to the links (give them display: block; height: 1%; and see what happens).

    What does your page look like?
     
    Dan Schulz, Mar 17, 2008 IP
  3. cbn81

    cbn81 Peon

    Messages:
    160
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    My code now is:

    ul.tabs {border:1px solid #194367; height: 20px; width: 520px; margin: 0; padding: 0; background:#C0D9DE; overflow:hidden; }
    ul.tabs li { float: left; background-image: url(tab.gif); display:inline; width: 82px; height: 20px; margin: 0px; padding: 0px; text-align: right; }
    ul.tabs a:hover, ul.tabs a.tab-active { text-decoration: none;}
    ul.tabs a { text-decoration: none; font-weight:bold; margin: 0; padding: 0; color:#2B4353; }
    HTML:
    And I still have the same problem...
     
    cbn81, Mar 18, 2008 IP
  4. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Can you show me the page? If I can see the page I should be able to tell you what's wrong and how to fix it. Especially since there's always the possibility that code elsewhere could be causing the problem you're seeing (or at least contributing to it).
     
    Dan Schulz, Mar 18, 2008 IP
  5. cbn81

    cbn81 Peon

    Messages:
    160
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I've sent you a PM
     
    cbn81, Mar 18, 2008 IP
  6. cbn81

    cbn81 Peon

    Messages:
    160
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Anyone else?
     
    cbn81, Mar 18, 2008 IP
  7. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Don't give up hope so quickly. I got side-tracked by a prospective client.
     
    Dan Schulz, Mar 18, 2008 IP
  8. cbn81

    cbn81 Peon

    Messages:
    160
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #8
    I'm still facing the same problem, I also tried to change a bit of code but I'm still stuck. The page is here
     
    cbn81, Mar 24, 2008 IP