如何更改日期选择器的 View ?例如,我可以删除一些元素或自己替换整个选择器吗?使用 type="date"对我来说很重要。是否只有 type="text"才有可能?默认情况下,日期选择器看起来像这样
default view http://clip2net.com/clip/m309328/8030a-clip-12kb.png?nocache=1
它是没有任何属性和类的标准日期选择器
代码:
<form>
Birthday:
<input type="date">
</form>
我想得到这个,例如
最佳答案
您在样式自定义方面非常有限,因为 HTML5 日期输入 UI 是从所用设备的操作系统中提取的,而不是在浏览器中呈现。
来自 this site :
You cannot currently style the appearance of the date picker. In WebKit, we have previously provided ways to style form controls with the -webkit-appearance CSS property or the ::-webkit-foo pseudo class selector. However the calendar popup does not provide such ways in WebKit because it is separate from the document, like a popup menu for , and there is not currently a standard for how to control styling on its sub-elements.
您最好使用自定义日期选择器,例如 jQuery例如。
关于javascript - HTML 日期选择器 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30361709/