Removing input background colour for Chrome autocomplete?

前端 未结 30 2373
失恋的感觉
失恋的感觉 2020-11-22 04:02

On a form I\'m working on, Chrome is auto-filling the email and password fields. This is fine, however, Chrome changes the background colour to a pale yellow colour.

30条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-22 04:29

    After 2 hours of searching it seems google still overrides the yellow color somehow but i for the fix for it. That's right. it will work for hover, focus etc as well. all you have to do is add !important to it.

     input:-webkit-autofill,
     input:-webkit-autofill:hover,
     input:-webkit-autofill:focus,
     input:-webkit-autofill:active {
     -webkit-box-shadow: 0 0 0px 1000px white inset !important;
      }
    

    this will completely remove yellow from input fields

提交回复
热议问题