HTML5 日期选择器的样式选项
HTML5 中的日期选择器基本上工作方式与 JavaScript 库非常相似,当我们专注于该字段时,将弹出日历,然后我们可以在月份和年份中导航以选择日期。
因此,如果你希望日期输入使用更多的间距和配色方案,则可以将以下内容添加到代码中。
::-webkit-datetime-edit { padding: 2 em; }
::-webkit-datetime-edit-fields-wrapper { background:green; }
::-webkit-datetime-edit-text { color: blue; padding: 0 0.3em; }
::-webkit-datetime-edit-month-field { color: red; }
::-webkit-datetime-edit-day-field { color: orange; }
::-webkit-datetime-edit-year-field { color: red; }
<input type = "date">
广告
数据结构
网络
RDBMS
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
Javascript
PHP