Forum Moderators: not2easy
I've been pulling my hair out with this one for a while now and I'm desperate for some help before the PC gets it!
Let me explain....
I'm currently building a new website for the School I work at and instead of just having a current page link for the nav bar I'd also like it to show on the links bar. For example, we have one section called 'ABOUT US', which is situated in the nav bar and then I have sub links on the left hand side of the page with regards to the 'ABOUT US' section. So if you click on 'ABOUT US' you'll then be presented with links on the left for that particular area.
I want to have these links also show which page you are currently on. I have used the Body ID ="ABOUT-US" and CSS to make the 'ABOUT US' link change colour which represents a current page link but I can't get it to work for the sub links at all.
I've tried adding a second body id and I've also tried using a class but it's not working at all.
I'll provide you with the link to the apple website to give you an idea of what I want. Notice you're in the 'Features' section and within that you're in the 'Music' section.
<snip>
Here's some code from the apple site:
<body id="music" class="features">
I can't seem to get the class to work yet the id works fine.
Really hope someone can help as it's seriously delaying me from finishing my website.
Thanks all,
RoEy
[edited by: swa66 at 11:10 am (utc) on May 20, 2009]
[edit reason] Only authoritative links please see ToS and forum charter [/edit]
let's say you menus are:
<ul class="mainmenu">
<li id="mmfeatures">features</li>
<li id="mmabout">about</li>
</ul>
...
<ul class="submenu">
<li id="smhot">hot</li>
<li id="smmusic>music</li>
</ul>
Let's say you want to use the id on the body to indicate the submenu and the class on the body to indicate the mainmenu that it is part of
.features #mmfeatures , .about #mmabout {
/* hightligh main menu here */
}
#hot #smhot, #music #smmusic {
/* highlight submenu here */
your body wuld then be of the form:
<body class="features" id="music">