<分区>
<分区>
当我在输入上单击鼠标时,下拉邮件列表,当我将鼠标移至 Miles 时,正在更改输入背景。如图所示。 如何删除或更改本次输入背景?
我已经试过“focus”,但是没用。
<input type="email" name="email" placeholder="Email">
input {
background: none;
&:focus {
background: none;
}
}
最佳答案
对于谷歌浏览器,您可以执行以下操作:
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
-webkit-box-shadow: 0 0 0 30px white inset !important;
}
<input type="text" name="name">
将 white
替换为所需的颜色。我从这个 SO answer 中截取了这个片段.深入研究该 SO 问题也是一个好主意,因为有略微不同的解决方案可能更适合您。
请记住,这是非标准的,应该避免使用它,但现在,这是您可以做的。 引用:MDN
关于javascript - 如何更改输入名称背景?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58095098/