消除 Chrome 在 html 表单的文本字段中所做的黄色突出显示

发布于 2024-09-06 04:32:04 字数 566 浏览 1 评论 0原文

可能的重复:
如何阻止 Chrome 将我网站的输入内容变黄盒子?

我有一个网络表单,当我从 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

爱要勇敢去追 2024-09-13 04:32:04

据我所知,目前还没有真正好的解决方案,因为这种样式被 Chrome 标记为 !important 。一个已知的解决方法是禁用自动完成,如下所示:

<form autocomplete="off">
 <input type="text" name="fieldname" />
</form>

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:

<form autocomplete="off">
 <input type="text" name="fieldname" />
</form>

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):

往昔成烟 2024-09-13 04:32:04

在 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文