Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove button glow in bootstrap-4

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

like image 522
nunomira Avatar asked Feb 06 '18 02:02

nunomira


People also ask

How do I change the focus glow in Bootstrap?

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.

How to add a glow effect to a button using CSS?

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.

How do I highlight the input element in Bootstrap 4?

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:

How to change the color of the box shadow in Bootstrap?

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.


2 Answers

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-*

like image 51
pradeep kumar Avatar answered Jan 03 '23 02:01

pradeep kumar


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;
}
like image 35
Bogdan M. Avatar answered Jan 03 '23 02:01

Bogdan M.