Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
What Am I Missing? Right Aligned CSS tabs
Old 12-16-2008, 12:29 AM What Am I Missing? Right Aligned CSS tabs
Super Talker

Posts: 117
Trades: 0
[EDIT] I've made some progress with the alignment and taken some of LadynRed's suggestions which are visible on the links and their source. I'll post again when I reach another empass tonight [/EDIT]

I found a working example of a tabbed box in CSS which I am trying to adapt to my website, viewable at http://mrbsdomain.com/tab1.html (inline CSS)

I've been working on this for a couple hours and I've resorted to just copying the code to mine and it still isn't working. I'm hoping another set of eyes will see something I'm missing.

The relevant code...
Code:
...
<body id="home">
<ul id="nav"><li id="tab-home"><a href="http://mrbsdomain.com/index.php">Home</a></li>
<li id="tab-portfolio"><a href="http://mrbsdomain.com/portfolio.php">Portfolio</a></li>
<li id="tab-gallery"><a href="http://mrbsdomain.com/gallery2/main.php">Gallery</a></li>
<li id="tab-vaio"><a href="http://mrbsdomain.com/vaio.php">Vaio</a></li>
<li id="tab-webcam"><a href="http://mrbsdomain.com/webcam.php">Webcam</a></li>
<li id="tab-about"><a href="http://mrbsdomain.com/about.php">About</a></li></ul>
  <!-- CONTENT STARTS HERE -->
  <div id="contentContainer">
http://mrbsdomain.com/index1.php and http://mrbsdomain.com/about.php

The CSS
Code:
...
#nav {
    border-bottom: 1px solid #fff;
    text-align: right;
    margin: 0;
    padding: 0px;
    z-index: 1;
}

#nav li {
    display: inline;
    overflow: hidden;
    list-style-type: none;
}

#nav a {
    float: left;
    color: #929395;
    text-decoration: none;
    font-size: 9pt;
    margin: 0 0 0 4px;
    padding: 6px 13px 8px 13px;
    border: 1px solid #1C1D1F;
    background: #1C1D1F url(http://www.mrbsdomain.com/images/tab-off.gif) repeat-x top left;
}

body#home #tab-home a,
body#portfolio #tab-portfolio a,
body#gallery #tab-gallery a,
body#vaio #tab-vaio a,
body#webcam #tab-webcam a,
body#about #tab-about a  {
    color: #222;
    background: #666 /* url(http://www.mrbsdomain.com/images/tab-on.gif) repeat-x top left */;
    border-color: #fff;
    border-bottom: 1px solid #666;
    font-weight: bold;
    }

#contentContainer {
    border: solid;
    z-index: 2;
    border-width: 0 1px 1px 1px;
        border-color: #FFFFFF;
    background: #666666;
    text-align: left;
    width: 956px;
    height: auto;
        margin-left: auto;
        margin-right: auto;
    padding: 20px;
    }
http://mrbsdomain.com/style1.css
__________________

Please login or register to view this content. Registration is FREE
| nx2000 at gmail | AIM - tagmisterb

Last edited by Mr. B; 12-16-2008 at 12:09 PM..
Mr. B is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-16-2008, 04:13 AM Re: What Am I Missing? Right Aligned CSS tabs
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
And are you going to tell us what the problem is?
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 12-16-2008, 10:43 AM Re: What Am I Missing? Right Aligned CSS tabs
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
Ok, the z-index on #nav is useless since it ONLY works on positioned elements.
Your #globalcontainer isn't "containing" it's contents, it's not wide enough - or the contents is spilling over. Putting clear:both on a non-floated container like that is utterly pointless.

Your #nav isn't 'containing' the list items inside it, the ul is only a few pixels high.
You need to at least define a height on the UL or the li elements.

The table for the page title and description are unnecessary, you can do that with divs and proper heading tags.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 12-16-2008, 02:53 PM Re: What Am I Missing? Right Aligned CSS tabs
Super Talker

Posts: 117
Trades: 0
After some prodding, I'm nearly there... http://mrbsdomain.com/about.php

[edit]I thought the remaining problem was IE only but it's actually almost universal ( http://browsershots.org/http://mrb.t....com/about.php ) [/edit] The active tab has a 2px bottom border which obscures the top white border which spans the UL and appears to be the top border of the content box. This works in firefox et. al. but in IE, the UL border-bottom is in front of the active tab bottom border. The example I was using does not seem to have this problem.

Relevant CSS
Code:
#nav {
    color: #fff;
    text-align: right;
    width: 100%;
    border-bottom: 1px solid #fff;
    margin: 0;
    padding: 7px 0 9px 0;
}

#nav li {
    display: inline;
    overflow: hidden;
    list-style-type: none;
}

body#home #tab-home a,
body#portfolio #tab-portfolio a,
body#gallery #tab-gallery a,
body#vaio #tab-vaio a,
body#webcam #tab-webcam a,
body#about #tab-about a  {
    color: #222;
    background: #D9D5A3 /* url(http://www.mrbsdomain.com/images/tab-on.gif) repeat-x top left */;
    border: 1px solid #fff;
    border-bottom: 2px solid #D9D5A3;
    font-weight: bold;
    }

#contentContainer {
    border: 1px solid #fff;
    border-top: 0;
        border-color: #FFFFFF;
    background: #D9D5A3;
    text-align: left;
    width: 946px;
    height: auto;
    padding: 20px;
    overflow: hidden;
    }
[edit]
Partially solved with addition of...

position: relative;
z-index: x;

...to content DIV and UL

Aside from some IE issues, border corner rendering differs by browser which is having a slightly adverse effect on the appearance of the border line.
http://browsershots.org/http://mrbsdomain.com/about.php

If there is a way to control this with CSS, I would be appreciative.
[/edit]

[edit]Solved... view the source and see http://mrbsdomain.com/style.css[/edit]
__________________

Please login or register to view this content. Registration is FREE
| nx2000 at gmail | AIM - tagmisterb

Last edited by Mr. B; 12-18-2008 at 12:17 PM..
Mr. B is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to What Am I Missing? Right Aligned CSS tabs
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.16464 seconds with 12 queries