做前端的童鞋一定经常遇到过chrome保存密码后input输入框会变成黄色,对于正在开发中的项目,老是出来黄色背景很是不爽。
然后我用!important设定后发现不能修改默认状态。最后用了阴影实现了
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus { box-shadow:0 0 0 60px #fff inset; -webkit-text-fill-color: #333; }
如果不想保存密码的话加个autocomplete=”off”到form或者input就行了。
相关链接:http://labs.enonic.com/articles/remove-forced-yellow-input-background-in-chrome
About the author