chrome中hack解决input:-webkit-autofill自定义样式

在使用chrome浏览器设计网页时,想将input背景改成透明,也就是

background-color:transparent;

可是效果并不如人意

hack方法:

input:-webkit-autofill,
        textarea:-webkit-autofill,
        select:-webkit-autofill{
            -webkit-box-shadow: 0 0 0 1000px transparent inset;
        }
View Code

1000px可以尽可能的小~~

参考:解决方案

更多知识分享:微笑空间站

原文地址:https://www.cnblogs.com/xuyongsky1234/p/4343953.html