Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save coltenkrauter/34ca748828ffd351930aaf34aaef6c72 to your computer and use it in GitHub Desktop.
Save coltenkrauter/34ca748828ffd351930aaf34aaef6c72 to your computer and use it in GitHub Desktop.
Remove Chrome's autofill background color on HTML inputs. This unique solution makes the background color to transparent rather then a solid color.
// Remove chrome autofill color from inputs
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
transition: background-color 5000000s ease-in-out 0s;
}
# Credit: https://stackoverflow.com/questions/2781549/removing-input-background-colour-for-chrome-autocomplete#answer-29350537
@carasmo
Copy link

carasmo commented May 5, 2022

Doesn't work in latest Chrome.

@Lokua
Copy link

Lokua commented Sep 27, 2022

Works for me.

@HighError
Copy link

Work with Chrome 108.0.5359.125 in React app. Thanks

@mohammedTerawe
Copy link

Thanks worked for me

@danitor1
Copy link

It works. Thank you!

@m0nclous
Copy link

m0nclous commented Feb 6, 2024

Worked for me. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment