I am using twitter bootstrap .btn, .btn-success, etc, classes to style the buttons on a webpage. Everything works great. Except when I click on the button, the button’s text color changes, and it won’t go back to original color until I click somewhere else on the page. What I would like to do is to avoid the initial text color change when I click on the button. Changing the color when I hover over it, is enough for me. Here is the html code for the button:
<a ui-sref="login" style="outline:none; text-decoration:none; box-shadow:none" class="btn btn-primary btn-outline btn-success btn-tadaa-logout" ng-if="!session.authenticated">Log ind</a>
Thanks in advance.
3
Answers
Wouldn’t adding the following fix the issue?:
To retain color after click you need to add following css:
Find Bootply Demo HERE
This is because your
A:Visited
style is overriding the default button text style;Wrap your
<a>
tag in another element and style it, e.g.<p class="btn-link"><a class="btn">
and includep.btn-link a:Visted { color:#fff }
in your CSS