Computer >> Computer tutorials >  >> Programming >> Javascript

Are there any style options for the HTML5 Date picker?


The date picker in HTML5 shows a popup like a calendar. This is the same as selecting the months and years and this adds the date.

Example

You can also customize the popup and add background color as well. You can try to run the following code to add style options for HTML date picker −

::-webkit-datetime-edit { padding: 4 em; }
::-webkit-datetime-edit-fields-wrapper { background:blue; }
::-webkit-datetime-edit-text { padding: 0 0.5em; }

The following is to edit a month, day and year field −

::-webkit-datetime-edit-month-field { color: white; }
::-webkit-datetime-edit-day-field { color: red; }
::-webkit-datetime-edit-year-field { color: red; }
::-webkit-calendar-picker-indicator { background:gray; }