chrome浏览器input变黄色

chrome表单自动填充后,input文本框的背景会变成黄色的,这是因为chrome会默认给自动填充的input表单加上input:-webkit-autofill私有属性,

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”。亲测无效,大概是浏览器升级了,总之是没有效果的。大概就是这些了,高手指教请留言评论!



 

发布者:admin,转转请注明出处:http://www.yc00.com/web/1740325768a4229437.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信