Шах Шах - 4 years ago 173
CSS Question

Remove the outline around a primary button

I try to override Bootstrap styles and all works perfect. But I noticed that when the user presses a primary button

<button class="btn btn-primary">Test</button>

It shows an blue outline and I can't remove it. I tried to override a class:

.btn:focus {
outline: none;

But it doesn't work. It still shows this f***ing blue outline. And I can't find where it declared because I am a noobie in CSS.

Primary button preview

P.S. If it can help I use the Chrome browser v.56.

Answer Source

Not the best way, but try !important.

I guess your bootstrap-styles are loaded after your other styles so you get overwritten.

EDIT: also consider using more precise selector´s would be a better way to go (see comment) also check this

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download