Click here to Skip to main content
15,891,431 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
I am redirecting to another page when user clicked the link in master page.
I want to highlight link when it is clicked
Posted
Updated 3-Jan-15 19:22pm
v2

I hope you are aware of some css properties which helps to highlight the link as follows.



CSS
a:hover {
    background-color: Green;
}
 
Share this answer
 
v2
Comments
Sergey Alexandrovich Kryukov 2-Jan-15 3:09am    
Correct, a 5.
—SA
Check this out: CSS Styling Links[^]
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 2-Jan-15 3:09am    
Right, a 5.
—SA
Peter Leow 2-Jan-15 3:16am    
Thank you, Sergey, Happy New Year to you!
Sergey Alexandrovich Kryukov 2-Jan-15 3:37am    
Thank you. Happy New Year!
—SA
I think he needs the color to change or css change after click of the link
So
a:focus/a:active would do.
Check the below fiddle:
Fiddle[^]
I hope this is what you need.
Please post back your queries if any.
Thanks.
 
Share this answer
 
v2
Comments
Member 11052105 4-Jan-15 5:51am    
after clicking link the page was redirecting to another page,the link was not highlighting.
[no name] 4-Jan-15 6:03am    
Try using a:visited, that would also work out, as has been used by Code Project, you can check in the Q/A section inspect element, onclick of a question the link yurns maroon with a:visited

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900