1.问题:在Google浏览器中,input输入框自动填充时,颜色会自动改变。和预期设计有出入,
2.分析:打开控制台查找元素中我们可以看到,自带样式如下
input:-internal-autofill-selected {
appearance: menulist-button;
background-color: rgb(232, 240, 254) !important;
background-image: none !important;
color: -internal-light-dark(black, white) !important;
}
3.解决方法:就可以解决自动填充样式了
input:-internal-autofill-previewed,
input:-internal-autofill-selected {
-webkit-text-fill-color: #000 !important;
transition: background-color 5000s ease-in-out 0s !important;
}