I need to color a input border bottom when the input is not focus. This is my html code:
<input type="number" id="nc" name="days" class="numero" placeholder="" min="0"><br />
This is my css code:
.numero {
border-bottom-color: red;
}
But it doesn't work. Anyone can help?
use this code
Working Fiddle
Add some border style:
The border is red in your example:
Simply use the shorthand to add a style, size and color and it works.
Now, in order to remove this when it is focused:
We use the
:not()
functionality with the:focus
to check if the element in question is not focused.You should define the border thickness in the css. You can write that like this
And on focus if you want another color you can like this
You can change the value of transparent to any other color of your preference.
for any query please comment. All the best