Bootstrap 4.1
How to remove blue border from the checkbox which appears on the focus?
I tried using the outline but it's not working.
The code I'm using is:
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="customCheck1">
<label class="custom-control-label" for="customCheck1">Check this custom checkbox</label>
</div>
The live version or example is: https://jsfiddle.net/hussainabid/mgdjprst/
Answer: Use CSS outline property In Google Chrome browser form controls like <input> , <textarea> and <select> highlighted with blue outline around them on focus. This is the default behavior of chrome, however if you don't like it you can easily remove this by setting their outline property to none .
To create a custom checkbox, wrap a container element, like <div>, with a class of . custom-control and . custom-checkbox around the checkbox.
In Bootstrap 4, the background color of the toggle switch is blue. This color can be changed by manipulating the custom-control-input class.
Use the accent-color property to change the checkbox color in CSS.
There is a box-shadow
on the following rule: .custom-control-input:focus ~ .custom-control-label::before
. You can remove it by adding the following CSS (after Bootstrap CSS):
.custom-control-input:focus ~ .custom-control-label::before {
box-shadow:none !important;
}
Note: Instead of !important
you can also be more specific.
Example:
.custom-control-input:focus ~ .custom-control-label::before {
box-shadow:none !important;
}
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/>
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css" rel="stylesheet"/>
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="customCheck1">
<label class="custom-control-label" for="customCheck1">Check this custom checkbox</label>
</div>
I don't know why the question was closed by duplicate. This has nothing to do with the outline
property. Bootstrap add his own outline with box-shadow
.
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