HTML 日期选择器视图
HTML date picker 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 是从正在使用的设备的 OS 中提取的,而不是在浏览器中呈现.
来自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。
如何更改日期选择器的视图?例如,我可以删除一些元素或自己替换整个选择器吗?使用 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 是从正在使用的设备的 OS 中提取的,而不是在浏览器中呈现.
来自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。