【发布时间】:2020-12-07 22:14:18
【问题描述】:
在 Firefox 中,input type="date" 在单击时会弹出一个日历。除了阻止单击时的默认行为外,我还没有找到隐藏日历的方法。我也不想使用type='text'。
有没有办法在 Firefox 中隐藏这个弹出式日历?
【问题讨论】:
标签: html css firefox calendar popup
在 Firefox 中,input type="date" 在单击时会弹出一个日历。除了阻止单击时的默认行为外,我还没有找到隐藏日历的方法。我也不想使用type='text'。
有没有办法在 Firefox 中隐藏这个弹出式日历?
【问题讨论】:
标签: html css firefox calendar popup
input::-webkit-calendar-picker-indicator{
display: none;
}
<input type="date" />
【讨论】:
如果您阻止 onClick 处理程序的默认操作,则弹出窗口不会显示在 Firefox 上。
<input type="date" onClick="event.preventDefault()" />
【讨论】: