您的位置:首页 > Web前端 > CSS

去掉chrome记住密码后的默认填充样式

2017-10-18 18:39 1381 查看
当chrome记住密码的时候,input框的背景会默认填充为黄色,如图所示



这是因为chrome做了这些个操作



对chrome默认定义的background-color,background-image,color使用important是不能提高其优先级的,其他属性可使用。

使用足够大的纯色内阴影来覆盖input输入框的黄色背景,处理如下

input:-webkit-autofill , textarea:-webkit-autofill, select:-webkit-autofill {
-webkit-box-shadow: 0 0 0px 1000px white inset;
border: 1px solid #CCC!important;
}


设置后结果如图



附加:我的项目是基于vue-cli的,在vue-cli项目中的index.html中,设置以上样式即可
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  chrome