Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide the icon on a HTML time input field in Chrome

In Chrome when you type="time" property to an input box you get a little icon clock icon next to the input. Is there a way of removing this little clock icon?

like image 560
beakersoft Avatar asked May 21 '20 12:05

beakersoft


People also ask

How do I hide the input time icon?

input[type="time"]::-webkit-calendar-picker-indicator { background: none; display:none; } removes the space too.

How do I show calendar pop when input type date is on focus?

Just make the calendar-picker icon the full height and width of the input!


1 Answers

Based on the answers to this question: Change date input triangle to a calendar icon

We can see that we need to override the -webkit-calendar-picker-indicator pseudo-element, for example:

input[type="time"]::-webkit-calendar-picker-indicator {
    background: none;
}

Here it is in Chrome by default

Default time picker

Here it is with -webkit-calendar-picker-indicator background none

Background none picker

Of course you're hiding the fact there is a clickable picker so you may well want to think again about how you're displaying this if it's read only or do some more styling.

And to pull in Eiriks useful contribution from below, to remove the space completely add:

display:none;
like image 63
Andrew Avatar answered Oct 06 '22 18:10

Andrew