input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
-webkit-box-shadow: 0 0 0 40px white inset !important;
}
You can use this code snippet to change the background colour of an input that is added by default in chrome browser. This code will only work for chrome browser.
We are using '-webkit-box-shadow' CSS property to remove the default color of input added by chrome browser. We are using 'white' colour for our box shadow value. You can use any colour in place of that but 'transparent' will not work for the same.
You can also change text color of input added by default in chrome browser by using '-webkit-text-fill-color' CSS property.
To change text color added by chrome by default, you can use CSS code