How to remove the glow that appears around the button when you click it?
<div class="container">
<div class="row">
<div class="col-md-12 mt-5">
<button type="button" class="btn btn-primary">Primary</button>
</div>
</div>
</div>
https://www.bootply.com/vHRldZZt8u
By default, all the textual <input> elements, <textarea>, and <select> elements with the class .form-control highlighted in blue glow upon receiving the focus in Bootstrap. However, you can modify this default focus glow or shadow styles by simply setting the CSS border-color and box-shadow property.
Now we add the definition of glow-button in our CSS. In order to have this glow animation only when user hovers over the button, we are using the CSS selector :hover. If you need to have a permanent glow effect on the button, all you need to do is to remove this :hover selection from the glow- button definition.
Actually, in Bootstrap 4.0.0-Beta (as of October 2017) the input element isn't referenced by input [type="text"], all Bootstrap 4 properties for the input element are actually form based. So it's using the .form-control:focus styles. The appropriate code for the "on focus" highlighting of an input element is the following:
ADDITION: if you want to style select elements, you have to add their selectors as well e.g.: .form-control:focus, select:focus { box-shadow: 0 4px 2px -2px grey; } If you are using Bootstrap 3.x, you can now change the color with the new @input-border-focus variable. See the commit for more info and warnings.
css:
.btn-primary:focus,
.btn-primary:active{
box-shadow:none !important;
outline:0px !important;
}
Try this CSS Code, Replace .btn-primary with your respective class .btn-*
I have this solution, it removes the glow from any element (css selector: *) of you can scope outlines on components but you will need to specify it in a CSS class.
*:hover,
*:focus,
*:active
{
outline: none;
box-shadow: none !important;
-webkit-appearance: none;
}
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