【问题标题】:Any solution to remove clear button <input type="time"/> on Firefox?在 Firefox 上删除清除按钮 <input type="time"/> 的任何解决方案?
【发布时间】:2020-03-11 03:43:22
【问题描述】:

我尝试禁用-隐藏清除按钮,但不适用于Firefox

但在ChromeEdgeSafari 上运行良好。知道为什么吗?有解决办法吗?

下面是CSS

input[type="time"]::-webkit-clear-button {
  display: none;
}

Image of output

【问题讨论】:

标签: css firefox input


【解决方案1】:

&lt;input type="time" required&gt; 隐藏重置按钮。

来源:我查看了https://bugzilla.mozilla.org/show_bug.cgi?id=1479708。 :)

【讨论】:

    【解决方案2】:

    尝试 visibility: hidden;visibility:collapsed; 但 display: none 应该也适用于 firefox,也许你使用了错误的选择器

    【讨论】:

    • 它们都不适用于 Firefox,但 visibility: hidden; 适用于其他浏览器
    • 对不起,我写了“collapsed”和它的崩溃
    【解决方案3】:

    你可以试试这个

    input[type="time"]::-webkit-clear-button {
        -webkit-appearance: none; 
        -moz-appearance: none;
        appearance: none;
    }
    

    【讨论】:

    • 在 Firefox 上不起作用 :( 仍然有清除图标
    猜你喜欢
    • 1970-01-01
    • 2015-01-26
    • 2018-04-30
    • 2011-03-14
    • 2017-08-31
    • 2018-06-28
    • 2018-08-06
    • 1970-01-01
    • 2020-09-23
    相关资源
    最近更新 更多