avanworld
asked on
How do I highlight a menu item (an active element ) of a simple text menu (LHS) ?
I am having a simple text menu in the LHS of the page. It is not a multi level menu. I want the menu item to be highlighted in white color when active and green otherwise. In short all menu items should be in green except the white one which is active (i.e highlighted)
Can you throw some light on this on how this can be achieved ? I am using struts and JSP
Can you throw some light on this on how this can be achieved ? I am using struts and JSP
a{color:green;}
a:hover{color:white;}
Like that?
If you want just a specific <a> element to have the changed (the above dose them all) then use something like
a#element{color:green;}
a:hover#element{color:whit e;}
or
a.element{color:green;}
a.element:hover{color:whit e;}
then place it in the <a> tag like so <a class="element" href="#">eh...?</a>
you can find some more information about this here
http://www.pixel2life.com/tutorials/css_stylesheets/rollovers/
I Hope this helps you out!!
- Animasu
a:hover{color:white;}
Like that?
If you want just a specific <a> element to have the changed (the above dose them all) then use something like
a#element{color:green;}
a:hover#element{color:whit
or
a.element{color:green;}
a.element:hover{color:whit
then place it in the <a> tag like so <a class="element" href="#">eh...?</a>
you can find some more information about this here
http://www.pixel2life.com/tutorials/css_stylesheets/rollovers/
I Hope this helps you out!!
- Animasu
ASKER
Hi CEHJ & Animasu,
The menu item which is active should be highlighted in white color when we view the page but not on mouse over. I mean it should be continuously highlighted in white while active and other menu items should continue to appear in green. When we select another menu item that should appear in white and the currently selected one should appear as green. This should happen dynamically when user keep on selecting different menu items.
The current solution what you have suggested works on mouseover but please provide a solution for the above. Any help is highly appreciated.
The menu item which is active should be highlighted in white color when we view the page but not on mouse over. I mean it should be continuously highlighted in white while active and other menu items should continue to appear in green. When we select another menu item that should appear in white and the currently selected one should appear as green. This should happen dynamically when user keep on selecting different menu items.
The current solution what you have suggested works on mouseover but please provide a solution for the above. Any help is highly appreciated.
You use a:active for what you want - see the link i posted
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://www.echoecho.com/csslinks.htm