chrome浏览器表单自动填充默认样式-autofill设置

1. 错误显示状态如下:因为Input输入框并没有使用【autocomplete="off"】关闭浏览器自带填充表单功能,于是出现自动填充时样式就变成这样了~

再来定位到输入框的样式,发现自动填充样式如图2

2. 解决第一步:修改样式如下,通过纯色的阴影覆盖底色。

虽然选择完成后,显示正常了;但是,鼠标点击选中状态依然还是有问题,如图3

input:-webkit-autofill, textarea:-webkit-autofill, select:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px #202123 inset;
  -webkit-text-fill-color: #C9E5FF;
}

3. 解决第二步:继续添加设置input样式动画。终于好了~

input:-webkit-autofill, textarea:-webkit-autofill, select:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px #202123 inset;
  -webkit-text-fill-color: #C9E5FF;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-transition-delay: 99999s;
    -webkit-transition: color 99999s ease-out, background-color 99999s ease-out;
}

猜你喜欢

转载自blog.csdn.net/wdm891026/article/details/115181662