【问题标题】:Input text very small when hovering on autofill suggestion悬停在自动填充建议上时输入文本非常小
【发布时间】:2019-12-06 03:28:17
【问题描述】:

在 MacOS(版本 75.0.3770.142)上的 Google Chrome 中,当我将鼠标悬停在自动填充建议上时,输入中的字体大小变得非常小(字体系列也发生了变化),但在选择了建议后,它又恢复了正常大小。

什么可能导致这种行为?

【问题讨论】:

标签: css macos google-chrome autofill


【解决方案1】:

有一个解决办法:

input:-webkit-autofill::first-line {font-size: 16px}

【讨论】:

  • 谢谢。但我注意到它不仅是字体大小,还有字体系列。
【解决方案2】:

这是 2021 年对我有用的工作解决方案,Chrome 不会在自动完成时更改字体大小建议悬停:

input#email {
  font-size: 2rem;
  color: blue;
}

input:-webkit-autofill::first-line {
      color: red;
      font-size: 2rem;
}
<input id="email"></input>

我还注意到由于某种原因display: flex 与该代码冲突,请查看:

input#email {
  font-size: 2rem;
  color: blue;
  display: flex;
}

input:-webkit-autofill::first-line {
      color: red;
      font-size: 2rem; 
}
<input id="email"></input>

【讨论】:

  • 在 macOS Chrome 版本 95 上不再为我工作。
【解决方案3】:

输入:-webkit-autofill,输入:-webkit-autofill:悬停,输入:-webkit-autofill:focus { // 把你的旧样式放在这里 }

【讨论】:

    猜你喜欢
    • 2016-07-26
    • 2019-10-16
    • 2018-03-29
    • 2018-10-25
    • 2021-02-02
    • 2015-10-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多