【发布时间】:2020-07-19 20:50:54
【问题描述】:
我有一个包含 2 个字段的登录表单,用户名和密码。用户名字段由 chrome 自动完成。当我提交表单时(当它有效时),这种样式被神秘地应用了:
input:-internal-autofill-selected {s ñ
background-color: rgb(232, 240, 254) !important;
background-image: none !important;
color: -internal-light-dark-color(black, white) !important;
}
有没有办法避免这种情况?表单是使用 Ajax 提交的,所以如果 Username 字段应用了该样式,则有点难看,但 Password 字段则没有。
我注意到只有当字段被 chrome 建议列表中的元素填充时才会发生这种情况。如果字段填充的值不在列表中,则不应用样式。
问候 詹姆
【问题讨论】:
标签: css google-chrome