Removing input background colour for Chrome autocomplete?

前端 未结 30 2403
失恋的感觉
失恋的感觉 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:30

    This is my solution, I used transition and transition delay therefore I can have a transparent background on my input fields.

    input:-webkit-autofill,
    input:-webkit-autofill:hover,
    input:-webkit-autofill:focus,
    input:-webkit-autofill:active {
        -webkit-transition: "color 9999s ease-out, background-color 9999s ease-out";
        -webkit-transition-delay: 9999s;
    }
    

提交回复
热议问题