A box-shadow
effect is applied to the CSS rule:
.custom-control-input:focus ~ .custom-control-label::before
. To remove this shadow, you can include the following custom CSS (after Bootstrap CSS):
.custom-control-input:focus ~ .custom-control-label::before {
box-shadow:none !important;
}
Note: Instead of using !important
, consider being more specific as outlined in the CSS specificity guide.
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>
The question was erroneously marked as a duplicate, even though it addresses the issue with the box-shadow
and not the outline
property. This is due to Bootstrap's default styling that includes a box-shadow
.