hsz hsz - 3 years ago 216
HTML Question

Google Chrome form autofill and its yellow background

I have design problem with Google Chrome and its form autofill function.
If Chrome remembers some login/password it changes a background color to a yellow one.

Here are some screenshots:

alt text
alt text

How to remove that background or just disable this autofill ?

Answer Source

Apply this CSS:

input:-webkit-autofill {
    color: #fff !important;
}

Just tested on my site and it doesn't work on background-color :(

Edit: After doing some research I found this jQuery:

if ($.browser.webkit) {
    $('input[name="password"]').attr('autocomplete', 'off');
}

Maybe that will help.


Fareed Namrouti's answer below is a far better solution.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download