Overriding custom CSS with a different class

I'm having trouble setting the "on" state for a tab of this menu. I ended up moving away from using UL and LI due to IE 6 rendering issues. Now I'm using a table.

The table works very well in target browsers with a rollover color error in Opera, but everything else is fine.

I need to have an "on" state for a loaded tab where it has a flipped text style.

Until now, I could not make any changes for the individual <TD>

.

The page is under construction http://hiv411.dreamhosters.com/page.php

Thanks a lot for any advice!

The table code looks like this:

<table border="0" cellspacing="0" cellpadding="0" class="tabs"> 
<tr> 
    <td class="tabs"><a href="page.php" class="tabs">First Link</a></td> 

    <td class="tabs"><a href="page.php" class="tabs">Another Link</a> </td> 

    <td class="tabOn"><a href="page.php" class="tabOn">A Third Link Which is Longer</a> 

</td> 
    </tr> 
</table>

      

The CSS looks like this:

.tabOn td {
    width:140px;
    height:29px;
   border: 1px solid #fff;
    background-image:none;
    background-color:#FFF;
    color:#000;
   font-size:9pt;
   font-weight:bold;
   text-align:center;
   white-space:nowrap;
}
.tabOn td a{
   color:#000;
   display: block;
   padding: 6px;
   padding-top:7px;
   height:17px;
   text-decoration: none;
   margin-top:1px;
   white-space:nowrap;
}

/* NORMAL STATE */

table.tabs {
   border-collapse: collapse;
}
table.tabs td {
    width:140px;
    height:29px;
   border: 1px solid #fff;
   background:url(/images/tabOverBG.jpg) repeat-x;
   background-position:bottom;
   font-size:9pt;
   font-weight:bold;
   text-align:center;
   white-space:nowrap;
}
table.tabs td a{
   display: block;
   padding: 6px;
   height:17px;
   text-decoration: none;
   margin-top:4px;
   white-space:nowrap;
}
table.tabs td a:link, table.tabs td a:visited {
   color: #fff;
}
table.tabs td a:hover, table.tabs td a:active, table.tabs td:hover {
   color: #000;
   background-color: #fff;
   background-image:none;
}

      

0


a source to share


2 answers


you need to change the css order, generic tag and classes first. And by applying the same table.tabs classes (so css does not override properties) you can save space, but not write the same properties to .tabOn twice:



table.tabs {
   border-collapse: collapse;
}
table.tabs td {
   width:140px;
   height:29px;
   border: 1px solid #fff;
   background:url(/images/tabOverBG.jpg) repeat-x;
   background-position:bottom;
   font-size:9pt;
   font-weight:bold;
   text-align:center;
   white-space:nowrap;
}
table.tabs td a{
   display: block;
   padding: 6px;
   height:17px;
   text-decoration: none;
   margin-top:4px;
   white-space:nowrap;
}
table.tabs td a:link, table.tabs td a:visited {
   color: #fff;
}
table.tabs td a:hover, table.tabs td a:active, table.tabs td:hover {
   color: #000;
   background-color: #fff;
   background-image:none;
}
table.tabs td.tabOn {
   background-image:none;
   background-color:#FFF;
   color:#000;
}
table.tabs td.tabOn a{
   color:#000;
   margin-top:1px;
}

      

+1


a source


Should it .tabOn td

be td.tabOn

? Also .tabOn td a

should betd.tabOn a



Now you have it for <tr class="tabOn">

+2


a source







All Articles