newcoder1010 Posted December 8, 2016 Share Posted December 8, 2016 Hello, I have two links: home and article. When I am on Home page, I like Home link to be in green background and When I am on articles page, I like Article link to be in green background. I used below links but it is not working. .nav > li > a:active { background-color: green; } Link to comment Share on other sites More sharing options...
dsonesuk Posted December 8, 2016 Share Posted December 8, 2016 :active only works on links that a clicked, you would only see for a moment, before it goes to next page, it also has a security risk to it where some could identify where you have been. You usually make up your own active class to change background .nav > li > a.active { background-color: green;} <a href="/" class="active">Home</a> Link to comment Share on other sites More sharing options...
newcoder1010 Posted December 8, 2016 Author Share Posted December 8, 2016 Thank you. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now