when i click on the link \"home\" class home should change and stay at class home1 till another link is clicked but it doesn\'t...class changes but on clicking the other link
The :active-state is only active while you hold down the mouse-button on the link! It is not active until you click another link! This could be done with jQuery:
$('a').click(function() {
$('a.lastClickedLink').removeClass('lastClickedLink');
$(this).addClass('.lastClickedLink');
});
The link that was clicked last will have the class lastClickedLink and can then be styled through css with a.lastClickedLink {}
.
If you want this class to be persistent when the user comes back to the page later, you will have to use a cookie. Use jQuery cookie for this.