Forum Moderators: not2easy
<html>
<a class="nav" href="index.php"><span>home</span></a>
<a class="nav" href="posters.php"><span>posters</span></a>
<a class="nav" href="pressbooks.php"><span>pressbooks & synopses</span></a>
<a class="nav" href="#"><span>stills & lobby cards</span></a>
<a class="nav" href="#"><span>books</span></a>
<a class="nav" href="comics.php"><span>comics</span></a>
<a class="nav" href="#"><span>magazines</span></a>
<a class="nav" href="#"><span>other collectables</span></a>
</html> ...and here is the css...
A.nav:link{
color: #000000;
background: #cccccc url("/images/left-menu-tab.gif") left top no-repeat;
text-decoration: none;
font-size:10pt;
padding-left: 10px;
font-weight:bold;
} A.nav:visited{
color: #000000;
background: #cccccc url("/images/left-menu-tab.gif") left top no-repeat;
text-decoration: none;
font-size:10pt;
padding-left: 10px;
font-weight:bold;
} A.nav:hover{
color: #000000;
background: #00CCFF url("/images/left-tab-hover.gif") left top no-repeat;
text-decoration: none;
font-size:10pt;
padding-left: 10px;
font-weight:bold;
} A.nav:active{
color: #000000;
background: #00CCFF url("/images/left-tab-hover.gif") left top no-repeat;
text-decoration: none;
font-size:10pt;
padding-left: 10px;
font-weight:bold;
} a span{
background: url("/images/right-menu-tab.gif") right top no-repeat;
padding-right: 10px;
} a:hover span{
background: url("/images/right-tab-hover.gif") right top no-repeat;
padding-right: 10px;
} I like the sound of the body id thing blobfisk. How exactly would I make it work with the code above?
body#PageID1 li#TabId1 a, body#PageID2 li#TabId2 a, etc {
settings: for current page;
}
The page will apply those rules only when it matches all the criteria, i.e., when there is a body tag with an id="PageID1" and a list item with an id="TabId1" it applies the rules to the link tag.
If there's a way to do this without having to explicitly set that whole list of combinations, I'd love to see it, but even having to list it in the CSS is WAY better than having to update an id="current" on every page...
Then in your CSS:
#homeID #home a.nav:link{
... Active Page Rules...
}
HTH
#homephp #homelink a.nav:visited{
color: #000000;
background: #00CCFF url("http://mydomain/images/left-tab-hover.gif") left top no-repeat;
text-decoration: none;
font-size:10pt;
padding-left: 10px;
font-weight:bold;
} #homephp #homelink a span{
background: url("http://mydomain/images/right-tab-hover.gif") right top no-repeat;
padding-right: 10px;
} Now I figured I only need to do this for the visited link, as it will be visited because they have just clicked on it. If anyone can foresee a problem with this please let me know.
This has delved me into more advanced css than I am used to but I think I get the idea. Can anyone point me to a good tutorial or reference for this kind of more complicated css?
body#PageOne li#LinkOne a {
blah blah
}
...this way it's not contingent upon any pseudo classes.
Check out Listamatic and several articles on A List Apart (Taming Lists and Suckerfish Dropdowns come to mind) for more advanced list/menu manipulation.