views:

518

answers:

1

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.

The design I'm working on is using light text on a dark background, so this really messes up the look of the form - I have stark yellow boxes and near-invisible white text. Once the field is focused, the fields return to normal.

Is it possible to stop Chrome changing the colour of these fields?

+4  A: 

Hello,

This has been as designed since this coloring behavior has been from WebKit. It allows the user to understand the data has been prefilled. Bug 1334

You could turn off autocomplete by doing (or on the specific form control:

<form autocomplete="off">
...
</form

Or you can change the colour of the autofill by doing:

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

This is a WebKit behavior.

Mohamed Mansour
@Mohamed, thanks but that webkit CSS rule isn't working. The user agent stylesheet is always overruling the background color, even with it (a) set to `!important` and (b) targeted with an ID for higher specificity. It looks like Chrome is always going to override it. Removing autocomplete does seem to work, but it's really not what I want to do.
DisgruntledGoat
Some people have the same issue, did you check the bug post?http://code.google.com/p/chromium/issues/detail?id=1334
Mohamed Mansour