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
.
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;
}
Show activity on this post. So use border: none; and that annoying blue border shall disappear!
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.
On Bootstrap 4.5.0 you can try
<button class="btn btn-primary shadow-none">ADD TEXT HERE</button>
It works for me.
Try this
#openPopup:focus {
outline: none;
}
or
#openPopup:focus {
outline: 0;
}
<button type="button" class="btn btn-link">Link</button>
Bootstrap
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