1

I have already used this.but it is not giving me any change

a.Grid:visited { border:1px ridge black; color:Purple; } <asp:LinkButton ID="lnkPage" runat="server" Text = '<%#Eval("Text") %>' CssClass="Grid"></asp:LinkButton> 
1
  • 1
    see if a.Grid:active { border:1px ridge black; color:Purple; } works for you Commented Oct 17, 2013 at 7:39

2 Answers 2

1

There are two things that you may want to achieve. one is change the color when link is clicked and another one is that color should remains same to indicate that particular link is clicked.

For the first option you can use :active pseudo class

a.Grid:active { border:1px ridge black; color:Purple; } 

And for the second option, you need to use little bit JS to apply the active class on the link

$('a.Grid').on('click',function(){ $(this).addClass("active"); }); 

You can define your active class as you want

.active { color:red; } 

Js Fiddle Example

Sign up to request clarification or add additional context in comments.

2 Comments

I am a bit new to asp.net. I didn't get what is function() and how to use this code snippet. Thanks for your response
You just need to write this under the script section of the .aspx page.
0

replace :visited with :active

it will change it's color as long as it's clicked.

1 Comment

thank you very much for your response. what actually grid css is not even executing though i keep visited or active

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.