| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| DesignersTalk > navigational menu -- show "hover" state for active page |
|
LinkBack | Thread Tools | Search this Thread |
|
|
#1 (permalink) |
|
Floating libation anyone?
|
navigational menu -- show "hover" state for active page
So, say I have this code for a basic side-navigational menu. Code:
...and the CSS that styles this area is: Code:
For each page, I want to display the hover/active state to indicate the current page. So in other words, if I'm on blah1.php, I want it to be underlined. Is there some sort of swanky CSS I could add (or a simple javascript that would degrade nicely) to easily accomplish this? Many thanks all... fun: HGC v.4 | last.fm: DT | me | oi! f*ck u roto: ...via meebo!
New to interweb design? Your friends at dt can help. Last edited by roto : 01-08-2007 at 21:44. Reason: Added me </li>s like a good pirate... |
|
|
|
|
|
#2 (permalink) |
|
I like code.
|
What about adding and ID to the current actively page's li item then just use something like Code:
Code:
|
|
|
|
#4 (permalink) |
|
goober :-)
|
ok... so for starters, you don't need the div around your menu... its redundant code. Put the styling on your ul instead. Then, why don't you consider coding it like this: Code:
If you attach those classes to each link (don't forget to close your LIs, by the way), and put an id on the body tag thats the same as the classes you've used (ie, "home" for the home page, "blah1" for the blah1 page etc), then you can do this with the css: Code:
basically, this matches the id of your body tag to the class of your LI. If they match, then it uses the style found within (Which, in this case, is the same as your hover state) hope that sorts you out. Cheers David My signature sucks.
|
|
|
|
#5 (permalink) | |
|
Floating libation anyone?
|
Quote:
I'll update this if/when there are more questions. TA. fun: HGC v.4 | last.fm: DT | me | oi! f*ck u roto: ...via meebo!
New to interweb design? Your friends at dt can help. |
|
|
|
|
#6 (permalink) |
|
Spare Parts
Join Date: Jan 2005
Location: Bracknell Forest
Posts: 4,962
|
This was the thread I was looking for.. dynamic lists |
|
|
|
#7 (permalink) | |
|
Floating libation anyone?
|
Quote:
fun: HGC v.4 | last.fm: DT | me | oi! f*ck u roto: ...via meebo!
New to interweb design? Your friends at dt can help. |
|
|
![]() |