chorme 浏览器记住密码后input黄色背景处理方法(两种)

使用chrome浏览器选择记住密码的账号,输入框会自动加上黄色的背景,有些设计输入框是透明背景的,需要去除掉这个黄色的背景;

方法1:阴影覆盖

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

由于是设置颜色覆盖,所以只对非透明的纯色背景有效;

方法2:修改chrome浏览器渲染黄色背景的时间

?
1
2
3
4
:-webkit-autofill {
  -webkit-text-fill-color: #fff !important;
  transition: background-color 5000s ease- in -out 0s;
}

完美解决


猜你喜欢

转载自blog.csdn.net/uncle_long/article/details/80797821