Chrome浏览器记住密码后再进入登录页后,输入框背景颜色变为黄色,字体颜色变成#000黑色,且添加的背景图片也那不显示了,进入审查元素后,发现浏览器默认给输入框添加了样式,并且无法通过important修改

input:-webkit-autofill, textarea:-webkit-autofill, select:-webkit-autofill {
background-color: rgb(250, 255, 189);
background-image: none;
color: rgb(0, 0, 0);
}

解决方法:

1.如果没有设置背景图片-通过白色阴影覆盖黄色,并设置字体颜色

input:-webkit-autofill {
-webkit-box-shadow: 0 0 0px 1000px #fff inset !important;/*白色*/
-webkit-text-fill-color: #323333;/*字体颜色*/
}

或通过延迟自动填充的时间

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
-webkit-transition-delay: 99999s;
-webkit-transition: color 99999s ease-out, background-color 99999s ease-out;
}

2.有背景图片

第一种:通过autocomplete="off"关闭浏览器自带填充表单功能

第二种:背景图片不写在input里,利用absolute置于input框上

<div class="inputWrap">
<span class="userLabel"></span>
<input placeholder="用户名" type="text" id="username" name="username">
</div>

  

最新文章

  1. 启动Tomcat内存溢出解决:java.lang.OutOfMemoryError: PermGen space
  2. C#软件设计——小话设计模式原则之:单一职责原则SRP
  3. 旅游行业的手机App Top5
  4. PS:缝线颜色随着鞋帮颜色的改变发生改变.files
  5. 数据结构:C_顺序栈的实现
  6. JS开发windows phone8.1系列之2
  7. iOS 设置 文字和 图片的位置
  8. 网络爬虫urllib2 tornado
  9. Mongodb:修改文档结构后出现错误:Element &#39;***&#39; does not match any field or property of class ***.
  10. Centos7 PHP7 编译安装 开机自启动
  11. ios第三方分享到qq、微信、人人网、微博总结
  12. Swift 一些环境配置
  13. 【简译】Windows 线程基础
  14. Can&#39;t initialize OCI. Error -1
  15. Java学习日记-7 抽象类和接口
  16. ViewPageAsImage
  17. A Graph Partitioning Game Theoretical Approach for the VNF Service Chaining Problem
  18. 快递单号自动识别接口API-trackingmore
  19. 0003.5-20180422-自动化第四章-python基础学习笔记--脚本
  20. Homebrew 备忘

热门文章

  1. linux 系统下 tar 的压缩与解压缩命令
  2. CentOS7安装codeblocks
  3. 将Emacs Org mode用于GTD任务管理
  4. sqli-labs(26a)
  5. Mybatis 中在xxx.mapper书写模糊查询
  6. mysql 5.7 安装配置及无法启动的问题解决
  7. mysql语句错误
  8. ACE官网
  9. iptables添加、删除端口
  10. Vue知识整理8:条件、URL、点击