谷歌浏览器中input自动填充默认背景色解决方法
1.input背景为半透明背景图
input:-webkit-autofill {
-webkit-animation: autofill-fix1 1s infinite; /**利用动画方式将背景图遮挡住*/
-webkit-text-fill-color: #94ccda; /**字体颜色可按需求定义*/
}
@-webkit-keyframes autofill-fix1 {
from {
background: url("./images/login/icon_lock.png") no-repeat 14px center;
}
to {
background: url("./images/login/icon_lock.png") no-repeat 14px center;
}
}
2.input背景为纯色背景
input:-webkit-autofill {
-webkit-box-shadow: 0 0 0px 1000px white inset; /**通过边框阴影遮挡住背景*/
-webkit-text-fill-color: #333;
}