首页 > 技术文章 > input 自动填充颜色改变或透明

chenfanga 2019-09-27 20:39 原文



设置黄色背景变成白色背景:

input:-webkit-autofill {
box-shadow: 0 0 0px 1000px white inset !important;
}  
input:-webkit-autofill:focus {
box-shadow: 0 0 0px 1000px white inset !important;
}  

设置透明:
input:-internal-autofill-previewed,
input:-internal-autofill-selected {
-webkit-text-fill-color: #FFFFFF !important;
transition: background-color 5000s ease-in-out 0s !important;
}

不要混合用、亲测有效

推荐阅读