I have a navigation bar on my webpage with links to different pages. Is there an easy way to automatically set the class on the navigation element corresponding to the current page? For instance, I want the “About Us” tab on the bar to have a different style if you’re currently viewing the “About Us” page. I know I could rig up some PHP for each page, but I’d rather have a more general set-it-and-forget-it solution.
Share
i’ve used this before and it works well.
http://www.cssnewbie.com/intelligent-navigation/