Jo Ju

Jo Ju

  • NA
  • 11
  • 0

Change Link Color

Jan 3 2006 7:19 PM
Hi, i am using asp.net and C#. I have 4 links which has a forecolor="red" Test1 Test2 Test3 Test4 when i click the first link Test1 i want it to change color say to forecolor="green" so that i will know that it is the active link and then when i click the second link Test2 i want Test2 to become the active link that is forecolor="green" and Test1 should become the link with the default color that is red. How should i go about? I am using a hyperlink control and the code looks like this.
But i have a small problem over here i havent specified the forecolor in the above hyperlink but it displays a default red color. Why does it do so?Have been trying to get rid of it but no luck. i have created a style sheet and have the following in it .urlLink a { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9px; color: red; font-weight: bold; text-decoration: none; } .urlLink a:link { color: red; } .urlLink a:active { color: green; } .urlLink a:visited { color: red; } and then i link the hyperlink to the stylesheet. But it doesnt work. So what is wrong???? Any help appreciated. Thanx in advance.

Answers (2)