Way 1: use CSS
I've noticed the same and even though it really annoys me, I believe there is no proper way of handling this.
I would recommend against all the other solutions given because they kill the accessibility of the button completely, so now, when you tab to the button, you won't get the expected focus.
This should be avoided!
Use a label instead of a button.
.btn:focus {Way 2:
outline: none;
}
I've noticed the same and even though it really annoys me, I believe there is no proper way of handling this.
I would recommend against all the other solutions given because they kill the accessibility of the button completely, so now, when you tab to the button, you won't get the expected focus.
This should be avoided!
.btn:focus {Way 3: use HTML in bootstrap
outline: none;
}
<button class="btn btn-primary btn-block" onclick="this.blur();">...Way 4: CSS
.not-focusable:focus {call class not-focusable
outline: none;
box-shadow: none;
}
<button class="btn btn-primary not-focusable">My Button</button>Way 5: Can't believe nobody has posted this yet.
Use a label instead of a button.
<label type="button" class="btn btn-primary btn-block">Way 6: Try this solution for remove border around the button. Add this code in css.
<span class="icon-plus"></span> Add Page
</label>
button:focus{Way 7: This worked for me. I created a custom class which overrides the necessary CSS.
outline:0px;
}
button:focus{
outline:none !important;
}
.custom-button:focus {
outline: none !important;
border: none !important;
-webkit-box-shadow: none !important;
box-shadow: none !important;
}
No comments:
Post a Comment