...

View Full Version : Hightlighted Links



duhh
07-10-2005, 01:05 AM
I need the code for a link to be highlighted when you are viewing it.

For example:
If on a webpage i have 4 links 1, 2, 3, 4

and i'm viewing link 3 that link 3 is highlighted so i know i'm viewing that link.

Jalenack
07-10-2005, 05:08 AM
Well the simplest way to do this without server-side coding is:

applying a unique id to the body tag of each page. Then using that to apply rules only if you're on that page. This'll make more sense once you see the code:



***Page 1***

<body id="page2">
...
<a href="#" id="page2link">
<a href="#" id="page3link">

...
</body>

*** Page 3***

<body id="page3">
...
<a href="#" id="page2link">
<a href="#" id="page3link">
...
</body>


and CSS:



#page2 #page2link, #page3 #page3link {
background: #fc3;
}


That will highlight #page2link only if you're on page 2, same goes with page 3. Comprende?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum