【问题标题】:Eliminate the yellow highlight that Chrome do in the textfiels on html forms [duplicate]消除 Chrome 在 html 表单的文本字段中所做的黄色突出显示 [重复]
【发布时间】:2011-03-05 12:53:49
【问题描述】:

可能重复:
How do I stop Chrome from yellowing my site's input boxes?

我有一个网络表单,当我从 Chrome 中看到它时,它会在文本字段上突出显示黄色,我不喜欢它。我用 outline: none; 消除了边框突出显示,但是当我返回我的表单和 Chrome 自动完成字段时,它会使字段背景变黄,这对我的主题不利。这是将背景从原来的透明更改为黄色的自动完成示例:

alt text http://img716.imageshack.us/img716/2231/yellowmal.png

我能做什么?

【问题讨论】:

    标签: html css autocomplete google-chrome styling


    【解决方案1】:

    在 StackOverflow 上查看类似的问题:Google Chrome form autofill and its yellow background

    简短的回答是没有办法做到这一点。浏览器和用户的偏好以及安全问题超越了网站设计。考虑到启用了自动填充功能的访问者可能习惯于在表单字段中看到黄色,因此当前的行为与他们的预期一致。

    【讨论】:

      【解决方案2】:

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

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

      在 chromium google 代码项目中提出了几个您可以投票的问题,但这个问题似乎是一个永无止境的故事(第一期始于 2008 年):

      【讨论】:

        猜你喜欢
        • 2017-07-04
        • 2021-05-12
        • 1970-01-01
        • 2013-01-23
        • 2012-03-16
        • 1970-01-01
        • 1970-01-01
        • 2017-01-03
        • 1970-01-01
        相关资源
        最近更新 更多