I have searched and searched and found many possible solutions but none of them work for me.

I have a very odd website setup (the client wants it that way) Setup (all next to each other):

Main menu (Menu block) Submenu (regular block) Main content (body)

What I need is the following: When a user clicks on a Main menu item the main menu item gets another color (last cliked menu link). When the user then clicks on a submenu item that submenu item gets another color (last clicked link). The main menu item can still have the color but this doesn't have to be. I just want a css rule to change the color of the last clicked link. So not just menu link but just the last link. Is it possible with just CSS or do I need something more? :)

  • try using .my-class-name:active { // do something; } – No Sssweat May 20 '16 at 5:13
  • else, you will need to use jQuery with a cookie, in which the cookie stores the name of the div that was last clicked. – No Sssweat May 20 '16 at 5:14
  • Thanks for the comments guys, i'll look further into it with your information! – user61463 May 25 '16 at 8:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.