I want to center date in input
, not input
inside div
. If I do centering, it centers date inside of part of input
because there is a right-hand side panel for choosing a date based on a calendar, which resizes dependently of input width.
Small code snippet for demonstration:
.center {
text-align: center;
}
<div>
<input type='date' class='center' value='2006-01-01' width='100'>
</div>
I tried to force centering with ignoring the right panel. Then the date is not fully visible.
Another approach was to find the size of calendar choice panel, and I did not find any mechanism both on StackOverflow and Internet to calculate the width, plus I did experiments with a ruler to find the proportion, and it also did not work.
The last, I tried searching into StackOverflow and did not find any similar questions.
In my project, I use plain JavaScript, jQuery, HTML, and CSS.