我在我的 chrome 浏览器中存储了地址,所以当我填写表格时,我会得到这样的弹出窗口:
如何更改 CSS,使输入字段不会变蓝。 我已经尝试过以下代码,但没有用:
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover
textarea:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus {
background-color: transparent;
}
最佳答案
当您选择自动填充建议时,您无法进行透明输入,但您可以使用以下 CSS 在自动填充建议后更改输入字段的颜色:
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:-webkit-autofill {
-webkit-text-fill-color: yellow !important;
}
关于html - 地址自动填充时如何更改输入字段样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55831693/