School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 300,378 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,539 people online right now. Registration is fast and FREE... Join Now!




CSS tab issues

 

CSS tab issues

BetaWar

26 Jun, 2009 - 11:21 PM
Post #1

#include <soul.h>
Group Icon

Joined: 7 Sep, 2006
Posts: 4,729



Thanked: 269 times
Dream Kudos: 1400
My Contributions
I am trying to get some tabs working for a site skin I am currently working on, everything is going fine other that I can't get my tabs working quite how I want.

Here is the relevant code:

CODE
<style>
  .navbar{
  }
  .navbar .spacer{
    background: url(images/navbar_bg.png) center bottom repeat-x transparent;
    height: 33px;
    display: inline;
    width: 70%;
    margin: 0px;
    float: left;
  }
  .navbar_left{
    background: url(images/navbar_bg_left.png) right bottom no-repeat transparent;
    width: 14px;
    height: 33px;
    float: left;
  }
  .navbar_right{
    background: url(images/navbar_bg_right.png) left bottom no-repeat transparent;
    width: 14px;
    height: 33px;
    float: right;
  }
  a.navLink{
    text-decoration: none;
    color: #0066ff;
    font-size: 20px;
  }
  span{
    margin: 0px;
    padding: 0px;
  }
  a.navLink .navLink_left{
    background: url(images/current_tab_bg_left.png) bottom right no-repeat transparent;
    width: 11px;
    height: 33px;
    float: right;
  }
  a.navLink .navLink_center{
    background: url(images/current_tab_bg.png) bottom center repeat-x transparent;
    padding: 9px 5px 0px 5px;
    height: 33px;
    float: right;
  }
  a.navLink .navLink_right{
    background: url(images/current_tab_bg_right.png) bottom left no-repeat transparent;
    width: 11px;
    height: 33px;
    float: right;
  }
  a.inavLink{
    text-decoration: none;
    color: #999999;
    font-size: 20px;
  }
  a.inavLink:hover{
    text-decoration: none;
    color: #0099ff;
    font-size: 20px;
  }
  a.inavLink:hover .navLink_left{
    background: url(images/current_tab_bg_ileft.png) bottom right no-repeat transparent;
    width: 4px;
    height: 33px;
    float: right;
  }
  a.inavLink:hover .navLink_center{
    background: url(images/current_tab_ibg.png) bottom center repeat-x transparent;
    padding: 9px 5px 0px 5px;
    height: 33px;
    float: right;
  }
  a.inavLink:hover .navLink_right{
    background: url(images/current_tab_bg_iright.png) bottom left no-repeat transparent;
    width: 4px;
    height: 33px;
    float: right;
  }
  a.inavLink .navLink_left{
    background: url(images/navbar_bg.png) center bottom repeat-x transparent;
    width: 4px;
    height: 33px;
    float: right;
  }
  a.inavLink .navLink_center{
    background: url(images/navbar_bg.png) center bottom repeat-x transparent;
    padding: 9px 5px 0px 5px;
    height: 33px;
    float: right;
  }
  a.inavLink .navLink_right{
    background: url(images/navbar_bg.png) center bottom repeat-x transparent;
    width: 4px;
    height: 33px;
    float: right;
  }
</style>

  <div class="navbar">

    <div class="navbar_right"> </div>

    <a href="#" class="inavLink">
      <span class="navLink_right"></span>
      <span class="navLink_center">Projects</span>
      <span class="navLink_left"></span>
    </a>

    <a href="#" class="navLink">
      <span class="navLink_right"></span>
      <span class="navLink_center">Home</span>
      <span class="navLink_left"></span>
    </a>


    <div class="navbar_left"> </div>
    <div class="spacer"> </div>

  </div>


Now, the problem is that I don't want to have to know the exact width of the navbar links to get the "spacer" to go all the way across, however when I try setting .spacer's width to 100% is pushes everything to different lines and ruins the skin.

Here are a couple of screenshots (taken from IE 6 so the transparency isn't there, but I believe you will get the point):
Current: Attached Image
When modified to 100%: Attached Image

Now, I would like this skin to use current standards, but if I can't get the navbar working I will have to swap it (the navba) out for a table to do the job (which people hate I know, so help me solve it ;P). The only problem I hae with giving navbar the background that spacer currently has is that it will be behind the currently selected menu as well, which has transparency in it and would ruin any hopes of making it look like the border continues up and around the tab.

User is offlineProfile CardPM
+Quote Post


RudiVisser

RE: CSS Tab Issues

27 Jun, 2009 - 06:25 PM
Post #2

.. does not guess solutions
Group Icon

Joined: 5 Jun, 2009
Posts: 1,872



Thanked: 137 times
Dream Kudos: 125
Expert In: PHP, MySQL, HTML, CSS, C#

My Contributions
Not sure I quite understand.. It's 03:20 and I've had a bit too much to drink, but below's a (sortof) representation of how I'd build that site's header.

IPB Image
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/7/09 09:22PM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month