I have a date input element.
<input type="date" >
The following red square is the default area the button can be clicked to open the date picker:
I wonder if it is possible to increase this area to make it easier to click, something wider like this:
Solutions in html, javascript or css are ok.
I have a date input element.
<input type="date" >
The following red square is the default area the button can be clicked to open the date picker:
I wonder if it is possible to increase this area to make it easier to click, something wider like this:
Solutions in html, javascript or css are ok.
Share Improve this question edited Mar 7, 2022 at 22:01 TylerH 21.1k77 gold badges79 silver badges112 bronze badges asked Dec 11, 2020 at 13:53 straminstramin 2,4003 gold badges32 silver badges66 bronze badges 3- An input is clickable on its entire width by default, you don't have to specifically click the icon to open the calendar. Or maybe this is browser-dependent, which browser forces you to click the icon? – Teemu Commented Dec 11, 2020 at 13:58
- I tried Chrome, Opera and Edge, I have to click in that area to open the date picker – stramin Commented Dec 11, 2020 at 14:04
- Ah ... It seems to work differently in FF. – Teemu Commented Dec 11, 2020 at 14:16
1 Answer
Reset to default 9Try using ::-webkit-calendar-picker-indicator
pseudo-element
#date-inp::-webkit-calendar-picker-indicator {
padding-left: 100px;
border: 1px dashed red;
}
<input type="date" id="date-inp"/>