最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

chrome浏览器input变黄色

运维笔记admin3浏览0评论

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



 

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论