How to change btn color in Bootstrap

Sam picture Sam · Feb 1, 2015 · Viewed 306.9k times · Source

Is there a way to change all .btn properties in Bootstrap? I have tried below ones, but still sometimes it shows the default blue color (say after clicking and removing the mouse etc). How can I change the entire theme altogether?

.btn-primary, .btn-primary:hover, .btn-primary:active, .btn-primary:visited {
    background-color: #8064A2;
}

Answer

Gold Pearl picture Gold Pearl · Feb 1, 2015

If you want to override any default properties in bootstrap you have to make the properties as important.

.btn-primary, .btn-primary:hover, .btn-primary:active, .btn-primary:visited {
    background-color: #8064A2 !important;
}

i hope this will works for you.