【问题标题】:How do you style autofill inputs in Firefox?您如何在 Firefox 中设置自动填充输入的样式?
【发布时间】:2019-09-12 03:26:30
【问题描述】:

input:-webkit-autofill 可用于 Chrome/Safari,但 input:-moz-autofill 似乎没有任何作用。有没有办法在 Firefox 中自定义自动填充样式?

【问题讨论】:

标签: css firefox autofill


【解决方案1】:

对于 Firefox,您可以这样做:

input {
  filter: none;
}

【讨论】:

  • 这应该是已接受的答案
【解决方案2】:

您可以在 Firefox 中设置自动填充样式,但只能使用 webkit-prefix。 (:-webkit-autofill)

要更改背景颜色,您需要 filter:none 和 chrome 中也需要的 box-shadow 技巧。

:-webkit-autofill { /* also works for firefox! */
    filter:none; /* u need this for firefox */
    box-shadow: 0 0 0 100px #8f88 inset;
}

【讨论】:

    猜你喜欢
    • 2020-10-24
    • 2011-12-15
    • 2019-10-09
    • 2018-12-06
    • 2016-01-08
    • 2020-05-30
    • 2010-09-26
    • 2020-04-15
    • 2019-09-13
    相关资源
    最近更新 更多