Results 1 to 2 of 2

Thread: UL navigation bar link to change when clicked

  1. #1
    Join Date
    Feb 2010

    UL navigation bar link to change when clicked


    Could someone take a look at http://www.bensbells.org/Test2.html

    I have a navigation bar that I created using CSS.

    I thought that the below CSS UL code would change and STAY when clicked -- so that the user can see what section of navigation s/he is currently on.

    ul#menu li a.active {

    However it does not -- and I was told that I might need some javascript to get what I want to work? Does anyone have an example or website I can look at to get this work, I seem to not be able to find one.


  2. #2
    Join Date
    Mar 2007
    The :active pseudo-class applies while an element is being activated by the user. For example, between the times the user presses the mouse button and releases it.

    Note: a:active MUST come after a:hover in the CSS definition in order to be effective!

    I would suggest not using javascript because it can be turned off and the you lose the effect. I suggest using server side code that checks the page you are on and then adds a class with the needed effect.
    "Hippies.They're everywhere. They wanna save the earth, but all they do is smoke pot and smell bad."-Cartman

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center