【发布时间】:2016-12-15 02:53:04
【问题描述】:
我遇到了一些类似的问题,例如:
Override browser form-filling and input highlighting with HTML/CSS 和 chrome : how to turn off user agent stylesheet settings?
但不幸的是,没有什么能帮助我解决我的问题。
我有一个网页,我将所有输入的背景设置为透明。
在 chrome 中,由于用户代理样式表,它保持黄色背景,我无法将其设置为白色或其他颜色。我也不能从开发设置中关闭,因为用户不会意识到这一点。
我需要一个 css 或 jquery 解决方案。
请帮忙。
更新 - 1
https://jsfiddle.net/hiralvadodaria/8b7a4o23/21/
使用这个 CSS 没有运气:
input:-webkit-autofill,
textarea:-webkit-autofill,
select:-webkit-autofill {
-webkit-box-shadow: 0 0 0px 1000px white inset;
background:none !important;
background-color: rgb(0,0,0,0) !important;
background-image: none !important;
color: rgb(0, 0, 0);
-webkit-box-shadow:none !important;
-moz-box-shadow:none !important;
box-shadow:none !important;
}
这是小提琴。但我无法在那里保存用户名/密码,因此无法显示确切的问题。
改为从我的项目中查找图像。
【问题讨论】:
-
您能提供一些示例代码供我们使用吗?最好是交互式的,例如来自 JSFiddle 之类的?
-
@TheReveller :我在问题中指出我根本不想要这种颜色.. 甚至不是白色!
标签: html css google-chrome