1

I have stored addresses in my chrome browser, so when I fill in a form, I get the popup like this : enter image description here

and when I select an address, the input fields turn blue like so : enter image description here

How do I change the CSS, so that the inputs fields don't get blue. I tried bellow code already, didn't work :

input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover
textarea:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus {
  background-color: transparent;
}
Sohail
  • 2,058
  • 7
  • 33
  • 57
  • 2
    Possible duplicate of [Removing input background colour for Chrome autocomplete?](https://stackoverflow.com/questions/2781549/removing-input-background-colour-for-chrome-autocomplete) – Studocwho Apr 24 '19 at 13:53

1 Answers1

3

You cant do transparent input when you selected autofill suggestions but you can change the color of an input field after autofill suggestion with below CSS:

input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active  {
-webkit-box-shadow: 0 0 0 30px white inset !important;
}

and you can change the text color of autofill suggestion:

input:-webkit-autofill {
-webkit-text-fill-color: yellow !important;
}
jitu thakur
  • 740
  • 3
  • 8
  • I am trying to change background color, not color. e.g background-color:transparent; , I have also tried with background-color:#000; that also doesn't work. – Sohail Apr 24 '19 at 14:24
  • yes, Sohail, you cant changed the background color of input after autofill suggestion selected but you can give box shadow on the input filed that will look same as the background color. try to up CSS code I have provided – jitu thakur Apr 24 '19 at 14:31