Jump to content

Different menu color for current page


rrdemello
 Share

Recommended Posts

Hello,Can anyone give me a quickstart with a piece of sample code for the following problem?I use a CSS based menu, with menu-items in color white. When I select an item, it colors red and then I go to the corresponding page. At this 'current' page I would like the chosen menu-item still to be red so that it stands out from the other menu-items. But that is not the case: it takes on the original white color again. Thanks,Ruud

Link to comment
Share on other sites

One way is to repeat the menu on each page and then manually change the CSS using inline styles on that page. Thats fine if you've got about 10 pages or less, as its not much time to go thru and edit them all.How many pages have you got?:)

Link to comment
Share on other sites

One way is to repeat the menu on each page and then manually change the CSS using inline styles on that page. Thats fine if you've got about 10 pages or less, as its not much time to go thru and edit them all.How many pages have you got?:)
The number of pages is not a problem, they are few. However, the inline styles should only change the color when the page is active, so I need a condition like "when the url == page-url", then change the colors. And I don't know how to retrieve the active url.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...