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