Forum Moderators: mack

Message Too Old, No Replies

Highlighting Current Selection on Menus

Simplest Way for a Newbie?

         

nehurd

6:47 pm on Feb 5, 2005 (gmt 0)

10+ Year Member



What is the easiest way to show the currently selected menu item in a different color? (e.g., current item is in white and all others are in black) I know this can be done on server side or with javascript. I'd like to use some free code, and want to know which method will be most manageable for a newbie. If you can point me to some code also, I'd be much obliged.

nehurd

6:50 pm on Feb 5, 2005 (gmt 0)

10+ Year Member



forgot to mention....if server-side solution, I'd like to use PHP.

webmannw

10:03 am on Feb 10, 2005 (gmt 0)

10+ Year Member



Hi,

Not sure if it's what your after but if it's a smallish site you have then you could always use a css 'class' to manually hilight the links. Something line this:

Add this class to your .css file changing the colour or style as needed:

.youarehere {
font-weight: bold;
background-color: #foo;
}

Then add the 'class' to the relevant menu item on the current page like this:

<li class="youarehere"><a href="index.htm">Home</a></li>
or
<td class="youarehere"><a href="index.htm">Home</a></td>

depending on if your using css or tables for layout.

Hope it helps.

nehurd

4:26 pm on Feb 10, 2005 (gmt 0)

10+ Year Member



thanks for the suggestion. I was trying to find an option that would work without having to edit each page.