简体   繁体   English

从Chrome电子邮件自动填充后摆脱输入上的黄色填充

[英]Getting Rid of Yellow Fill On Input After Email Auto-Fill From Chrome

I have a simple username-password form set up with some styles applied to it. 我有一个简单的用户名-密码表单,上面设置了一些样式。 It works great. 效果很好。 The problem comes when I login more than one time. 当我多次登录时出现问题。

Namely, since Chrome recognizes my email, it tries to auto-fill it. 也就是说,由于Chrome浏览器可以识别我的电子邮件,因此会尝试自动填充。 If I oblige, the username textbox acquires a repulsive yellow color. 如果我愿意的话,用户名文本框将变为黄色。 See images below for screenshots. 请参见下面的图片以获取屏幕截图。

How can I stop this from happening? 我该如何阻止这种情况的发生? I have not tested thoroughly, but it seems that neither Firefox nor Safari has this issue. 我没有进行彻底的测试,但是Firefox和Safari似乎都没有此问题。

空表格

自动填充发生后。

You can use :-webkit-autofill CSS pseudo-class, it matches when an element has its value autofilled by the browser. 您可以使用:-webkit-autofill CSS伪类,当元素的值由浏览器自动填充时,它将匹配。

input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px white inset !important;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM