i have this css to change the text selection color which works great:
::selection {
background: #e4d2ba;
}
but how can i change the color of the selection of numbers in this time input?
these dont seem to work for me:
input::selection {
background: #e4d2ba;
}
input[type=time]::selection {
background: #e4d2ba;
}
UPDATE: (regarding possible duplicate) this post has a lot of information on styling time inputs, but nothing on changing the selection color
this works:
input[type=time]::-webkit-datetime-edit-hour-field:focus,
input[type=time]::-webkit-datetime-edit-minute-field:focus,
input[type=time]::-webkit-datetime-edit-second-field:focus,
input[type=time]::-webkit-datetime-edit-ampm-field:focus {
background-color: #e4d2ba;
}
my confusion was based on assuming the numbers were in a selection
state since it looked like the same color as default selected text to me. but actually it's the background color of each whole field when focused. which was also surprising since i had assumed the whole combined time field held the focus
due to the default blue border
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