Design News:
CSS Current Page Indicator
How to highlight the current page's link in a navigation menu using only CSS, no scripting.
Comments (6)
not so sure that is any different than assigning which nav item is “current” in the menu itself. You’re just using the body class to do the same thing. If the bosy class is already being used for something then I guess it makes sense, but just using the body class primarily to specify the page you are on for the nav menu isn’t any different then bringing it down into the menu itself.
Do you have any other suggestions on how to do this?
I have been stumped on this for about a year now :>)
are you speaking about indicating the lage you are on without using any server-side code? or just indicating the current nav item?
A decent solution, but I could see this becoming a bit unwieldy if the navigation had a lot of links.
If you’re able to do some server-side coding, a relatively simple PHP if statement could look at the URL to see what page the user is on and then assign a “you are here” class to the appropriate nav item.
I am looking for a simple solution (PHP, Javascript, css)to indicate what page you are currently on… then style it differently.
This technique is done everywhere, but I have yet to find a way outside of coding every page with custom code. Meaning changing code on ever static page.
Ideally I would like to have 1 navigation file, include that and based on where it is on the site, it would know to style the navigation a certain way.
Thanks for you input.
Sincerely
Tom
PS Pat do you know of any tutorials or code examples explaining further what you suggest? Sound good to me :>)