Help to change colors of dynamically generated Hyperlink on click

Posted by Hidinesh29 under ASP.NET on 6/5/2010 | Views : 3052 | Status : [Member] | Replies : 1
HI All,

I have an application where I am using Master and content page concept. In my master page I have a header navigation and a left navigation bar. My requirement is when any IMages in the header column is clicked, its sub functions must appear in the left navigation bar which I have done using dynamically generated hyperlinks. But my second requirement is when any of these generated hyperlinks are clicked, they must changes color to indicate that they are highlighted, for example from white to red background. Please advice as how to achieve this.



Posted by: Deeraj on: 6/7/2010 [Member] Starter


Have a style sheet like the following and reference it in your master/detail page as applicable and this should get applied to all the hyperlinks.
Notice the list of states that a hyperlink can have: visited, hover, active etc.

<style type="text/css">
a:link {
COLOR: Blue;
a:visited {
a:hover {
COLOR: White;
a:active {
COLOR: Magenta;

Hope that helps!

Hidinesh29, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response