javascript - HTML 日期选择器 View

标签 javascript css html datepicker

如何更改日期选择器的 View ?例如,我可以删除一些元素或自己替换整个选择器吗?使用 type="date"对我来说很重要。是否只有 type="text"才有可能?默认情况下,日期选择器看起来像这样

default view http://clip2net.com/clip/m309328/8030a-clip-12kb.png?nocache=1

它是没有任何属性和类的标准日期选择器

代码:

<form>
    Birthday:
    <input type="date">
</form>

我想得到这个,例如 custom view

最佳答案

您在样式自定义方面非常有限,因为 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/

相关文章:

javascript - 基于条件的数组操作JS

javascript - Angular 部分不会将编辑传播到应用程序

javascript - 让 Javascript 在鼠标悬停时显示一些文本

javascript - 如何获取剪贴板数据的base64字符串?

html - 为什么父 Div 会被链接?

javascript - 在 Javascript 中模拟点击事件

css - 基金会 : vertical sub-nav

javascript - 类型错误 : Cannot read property 'summary' of undefined React Js

javascript - 数据传输在 IE11 中无法正常工作

javascript - 显示时动态 td 不调整大小