input自动填入密码以后变成白色和黄色的解决办法

问题描述:

1、谷歌自动输入账号密码以后颜色变成黄色;

解决办法:

加样式:

input:-webkit-autofill {

background: red !important;

color: #000;

}

 2、输入框设置成其他颜色,账号密码输入以后变成白色;

解决办法:

加样式,使用!important提高其优先级

input:-webkit-autofill {

background: red !important;

color: #000;

-webkit-box-shadow: 0 0 0px 1000px red inset !important;

}

输入框的字体变成白色

input:-webkit-autofill {

background: red !important;

color: #000;

-webkit-box-shadow: 0 0 0px 1000px red inset !important;

 -webkit-text-fill-color:#fff; 

}

原文地址:https://www.cnblogs.com/chengmingxiaowu/p/7601823.html