I am attempting to modify the color of the bottom border when input type number is focused. I have partially succeeded, but the CSS is not being applied to all selectors. Here is the issue:
https://i.sstatic.net/OOBVj.png
The left side (peso) is not in focus, yet it shares the same selector as Kg. Here is the code: https://jsfiddle.net/snake93/nLdrcv71/1/
input[type=number] {
color: #666;
border-width: 0px 0px 1px 0px !important;
border-color: #dcdcdc !important;
border-radius: 0px !important;
background: #fafafa00;
}
.input-group-text {
display: -ms-flexbox;
display: flex;
-ms-flex-align: center;
align-items: center;
padding: .375rem .75rem;
margin-bottom: 0px;
font-size: 1rem;
font-weight: 400;
line-height: 1.5;
color: #495057;
background-color: #ffffff00 !important;
border: 1px solid #dcdcdc !important;
border-radius: .25rem;
border-width: 0px 0px 1px 0px !important;
border-radius: 0px !important;
}
.form-control:focus,
.form-control:focus + span {
color: #00a1ff;
background-color: #fff0;
border-color: #00a1ff !important;
outline: 0;
box-shadow: none !important;
border: solid;
border-width: 0px 0px 2px 0px !important;
}
.input-group-text:focus {
background:red !important;
}
<link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="8defe2e2f9fef9ffecfdcdb8a3bca3bc">[email protected]</a>/dist/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/@popperjs/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b7d4d8c5d2f785998e9984">[email protected]</a>/dist/umd/popper.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="c1a3aeaeb5b2b5b3a0b181f4eff0eff0">[email protected]</a>/dist/js/bootstrap.min.js" ></script>
<div class="input-group mb-3">
<span class="input-group-text">Peso</span>
<input type="number" class="form-control">
<span class="input-group-text">Kg</span>
</div>