admin管理员组文章数量:1026989
chrome表单自动填充后,input文本框的背景会变成黄色的,这是因为chrome会默认给自动填充的input表单加上input:-webkit-autofill私有属性,填充了下面的样式:
input:-webkit-autofill {
background-color: #FAFFBD;
background-image: none;
color: #000;
}
查看了很多资料:有两种解决方案,暂时
第一种:适用于纯色背景
input:-webkit-autofill {
-webkit-box-shadow: 0 0 0px 1000px white inset;
border: 1px solid #CCC!important;
}
第二种:有背景图的
input:-webkit-autofill
{ -webkit-animation: autofill-fix 1s infinite; }
@-webkit-keyframes autofill-fix
{
from { background-color: transparent }
to { background-color: transparent }
}
意思是让颜色永远在transparent到transparent进行循环动画。
有人说:在form标签上直接关闭了表单的自动填充功能:autocomplete=”off”。亲测无效,大概是浏览器升级了,总之是没有效果的。大概就是这些了,高手指教请留言评论!
chrome表单自动填充后,input文本框的背景会变成黄色的,这是因为chrome会默认给自动填充的input表单加上input:-webkit-autofill私有属性,填充了下面的样式:
input:-webkit-autofill {
background-color: #FAFFBD;
background-image: none;
color: #000;
}
查看了很多资料:有两种解决方案,暂时
第一种:适用于纯色背景
input:-webkit-autofill {
-webkit-box-shadow: 0 0 0px 1000px white inset;
border: 1px solid #CCC!important;
}
第二种:有背景图的
input:-webkit-autofill
{ -webkit-animation: autofill-fix 1s infinite; }
@-webkit-keyframes autofill-fix
{
from { background-color: transparent }
to { background-color: transparent }
}
意思是让颜色永远在transparent到transparent进行循环动画。
有人说:在form标签上直接关闭了表单的自动填充功能:autocomplete=”off”。亲测无效,大概是浏览器升级了,总之是没有效果的。大概就是这些了,高手指教请留言评论!
版权声明:本文标题:chrome浏览器input变黄色 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/jiaocheng/1740325768a1752067.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论