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?
I have a better solution.
Setting the background to another color like below didn't solve the problem for me because I needed a transparent input field
So I tried some other things and I came up with this:
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:
Or you can change the colour of the autofill by doing:
Note, there is a bug being tracked for this to work again: http://code.google.com/p/chromium/issues/detail?id=46543
This is a WebKit behavior.
I've got a solution if you want to prevent the autofill from google chrome but its a little bit "machete" , just remove the class that google chrome adds to those inputs fields and set the value to "" if you dont need to show store data after load.
Simple, just add,
to the password field.
In addition to this:
You might also want to add
Other wise, when you click on the input, the yellow color will come back. For the focus, if you are using bootstrap, the second part is for the border highlighting 0 0 8px rgba(82, 168, 236, 0.6);
Such that it will just look like any bootstrap input.
I have a pure CSS solution which uses CSS Filters.
The grayscale filter replaces the yellow with grey, then the brightness removes the grey.
SEE CODEPEN