I have this page with a lot of buttons here: https://jsfiddle.net/Android272/c150305z/
I have tried every combination of the below code but nothing will get rid of the outline.
*:focus,
button,
button:focus,
button:active {
outline: 0;
outline-width: 0;
outline: none;
outline-style: none;
}
Theoretically, one could write:
button {
outline: none;
}
This will remove the select border from a button. However, in this case we require !important
on the outline property to prevent Bootstrap from overwriting it (seen below). I would also recommend adding cross-browser support for a known bug with Chrome and Firefox.
button {
outline: none !important;
}
input[type="button"]::-moz-focus-inner {
border: 0;
}
Alternatively, Bootstrap has these styles associated with buttons on focus that you need to either remove or overwrite.
.btn.active.focus,
.btn.active:focus,
.btn.focus,
.btn:active.focus,
.btn:active:focus,
.btn:focus {
outline: thin dotted;
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
}
Use this to overwrite it:
.btn.active.focus,
.btn.active:focus,
.btn.focus,
.btn:active.focus,
.btn:active:focus,
.btn:focus {
outline: none;
}
Updated your fiddle here: Working Fiddle
just this line:
button {
outline: none !important;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With