在做登录界面的时候, 谷歌浏览器input在自动填充时会出现黄色背景, 影响界面效果, 如图:
是因为, 谷歌浏览器在input自动填充时添加了如下属性:
解决方法:
用自己写的样式覆盖不了自动添加的属性.
所以用足够大的内阴影覆盖:
input:-webkit-autofill, textarea:-webkit-autofill, select:-webkit-autofill { -webkit-box-shadow: 0 0 0px 1000px white inset !important; background-image: none; color: rgb(0, 0, 0); }结果:
