消除 Chrome 在 html 表单的文本字段中所做的黄色突出显示
我有一个网络表单,当我从 Chrome 中看到它时,它会在文本字段上突出显示黄色,但我不喜欢它。我用 outline: none; 消除了边框突出显示,但是当我返回表单并且 Chrome 自动完成字段时,它会使字段背景变成黄色,这对我的主题不利。这是自动完成的示例,它将背景从原来的透明更改为黄色:
alt text http://img716.imageshack.us/img716/2231/yellowmal.png
我能做什么?
Possible Duplicate:
How do I stop Chrome from yellowing my site's input boxes?
i have a web form that when i see from Chrome it makes a yellow highlight on the text fields and i dont like it. I eliminate the border highlight with outline: none; but when i go back to my form and Chrome autocomplete the fields it makes the fields background yellow, and that is not good for my theme. This is an example of the autocomplete that changes the background from my original transparent to yellow:
alt text http://img716.imageshack.us/img716/2231/yellowmal.png
What can i do?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
据我所知,目前还没有真正好的解决方案,因为这种样式被 Chrome 标记为
!important
。一个已知的解决方法是禁用自动完成,如下所示:chromium google code 项目中提出了几个问题,您可以在其中投票,但这个问题似乎是一个永无止境的故事(第一期于 2008 年开始):
As far as I know there is no real good solution out there at the moment since this style is marked as
!important
by Chrome. A known workaround means to disable autocomplete like this:There are several issues raised in the chromium google code project where you could vote on but this issue seems to be a never ending story (first issue was started in 2008):
在 StackOverflow 上查看类似的问题:Google Chrome 表单自动填充及其黄色背景
简而言之,没有办法做到这一点。浏览器和用户偏好以及安全问题优先于站点设计。考虑到启用了自动填充功能的访问者可能习惯于在表单字段中看到黄色,因此当前的行为与他们的期望一致。
Check out this similar question on StackOverflow: Google Chrome form autofill and its yellow background
The short answer is that there is no way to do this. Browser and user preferences and security concerns override site design. Consider that your visitors with autofill enabled are probably used to seeing yellow in form fields, so the current behavior is consistent with their expectations.