Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot remove bootstrap button border

I have a custom bootstrap button and I cannot remove its border after click. I was able to change its background color but there is an insistent blue border boring me.

I click on it, it opens a modal window and after closing the modal the border is still there until I click on another part of the page even if I change values in :active and :focus.

enter image description here

html:

<button id="openPopup" type="button" class="btn btn-primary btn-lg text-uppercase" data-toggle="modal" data-target="#myModal">
    some text here
</button>

css:

#openPopup {
  padding: 20px 30px;
  background-color: #a2238e;
  border-color: #a2238e;
  box-shadow: 1px 1px 1px #999;
  white-space: normal;
  font-size: smaller;
  letter-spacing: 0.2px;
}

#openPopup:hover, #openPopup:active, #openPopup:focus {
  background-color: #912284 !important;
  border-color: #912284 !important;
}
like image 767
madsongr Avatar asked Apr 14 '18 21:04

madsongr


People also ask

How do you hide the outline of a button?

Show activity on this post. So use border: none; and that annoying blue border shall disappear!

How do I remove the outline button in CSS?

If you want to remove the focus around a button, you can use the CSS outline property. You need to set the “none” value of the outline property.


3 Answers

On Bootstrap 4.5.0 you can try

<button class="btn btn-primary shadow-none">ADD TEXT HERE</button>

It works for me.

like image 92
Fabio Duarte Avatar answered Sep 19 '22 06:09

Fabio Duarte


Try this

#openPopup:focus {
    outline: none;
}

or

#openPopup:focus {
    outline: 0;
}
like image 41
Troyan Victor Avatar answered Sep 22 '22 06:09

Troyan Victor


Try This

<button type="button" class="btn btn-link">Link</button> Bootstrap

like image 40
Ayman Elshehawy Avatar answered Sep 19 '22 06:09

Ayman Elshehawy