如何删除 chrome 自动完成的蓝色背景
how to remove blue background on chrome autocomplete
我正在制作一个表单并希望每个输入都是透明的,但是当我在 Chrome 中使用自动完成功能然后切换到下一个字段时,前一个字段会变成淡蓝色背景。
我试过使用:
input:-webkit-autofill:focus {
-webkit-box-shadow: 0 0 0 30px white inset !important;
transition: background-color 5000s ease-in-out 0s;
}
但这不起作用。我不想要白色背景我希望它在单击另一个输入时保持透明并将 color
设置为 transparent
也不起作用。
如何实现?
您可能无法使用 CSS 在 Chrome 上将其删除。最近这变得越来越困难,因为 Google 对开发人员试图隐藏或操纵其面向消费者的功能的所有方式都很流行。至少他们最近更改为蓝色背景而不是黄色。为了完全避免,我发现的唯一方法是使用隐身或访客 window。
Google 似乎对影子 属性 施了魔法。这使它对我有用:
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 {
-webkit-box-shadow: 0 0 0px 1000px #ffffff inset !important;
}
我正在制作一个表单并希望每个输入都是透明的,但是当我在 Chrome 中使用自动完成功能然后切换到下一个字段时,前一个字段会变成淡蓝色背景。
我试过使用:
input:-webkit-autofill:focus {
-webkit-box-shadow: 0 0 0 30px white inset !important;
transition: background-color 5000s ease-in-out 0s;
}
但这不起作用。我不想要白色背景我希望它在单击另一个输入时保持透明并将 color
设置为 transparent
也不起作用。
如何实现?
您可能无法使用 CSS 在 Chrome 上将其删除。最近这变得越来越困难,因为 Google 对开发人员试图隐藏或操纵其面向消费者的功能的所有方式都很流行。至少他们最近更改为蓝色背景而不是黄色。为了完全避免,我发现的唯一方法是使用隐身或访客 window。
Google 似乎对影子 属性 施了魔法。这使它对我有用:
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 {
-webkit-box-shadow: 0 0 0px 1000px #ffffff inset !important;
}