If you want to hide the clear button, you can use the following CSS code:
::-webkit-clear-button
{
display: none; /* Hide the button */
-webkit-appearance: none; /* turn off default browser styling */
}
For IE10+ browsers, you can achieve this using:
::-ms-clear { }
Note that the above code works for <input type="text" />
, as IE now includes a clear button there as well.
To customize the appearance of the date control in WebKit browsers, consider exploring this resource. Here are some pseudo classes you can leverage:
::-webkit-datetime-edit { }
::-webkit-datetime-edit-fields-wrapper { }
::-webkit-datetime-edit-text { }
::-webkit-datetime-edit-month-field { }
::-webkit-datetime-edit-day-field { }
::-webkit-datetime-edit-year-field { }
::-webkit-inner-spin-button { }
::-webkit-calendar-picker-indicator { }
Additionally, it is beneficial to disable default browser styles with the following code, particularly when dealing with mobile browsers:
input[type="date"]
{
-webkit-appearance: none;
}