-5

input text background color is set as yellow, only in chrome. How to remove this color?

enter image description here

I already tried to set background-color and everything but is still yellow

mbrc
  • 3,523
  • 13
  • 40
  • 64

4 Answers4

4

Either turn autocomplete off by adding the autocomplete="off" attribute to your HTML element, or use CSS:

input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0px 1000px white inset;
}
Stuart
  • 6,630
  • 2
  • 24
  • 40
1

It's yellow as chrome's default filled-in-color for auto-filled elements is yellow. Default browser CSS:

input:-webkit-autofill, textarea:-webkit-autofill, select:-webkit-autofill {
    background-color: rgb(250, 255, 189);
    background-image: none;
    color: rgb(0, 0, 0);
}

So, change yellow to any other color like this:

input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 500px white inset;
}
0

Set autocomplete="false" otherwise set Background color for input box

veera
  • 329
  • 1
  • 6
-1

This background color is set because of Browser's auto-fill property for username and password.

You can use autocomplete = 'off' attribute for this, just set this in you input tag.

Or you can use below css for this:

input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0px 1000px white inset;
}

Or you can use jquery for this like below:

$('#input_id').attr('autocomplete', 'off');
Paolo Forgia
  • 6,572
  • 8
  • 46
  • 58
Deepak Dholiyan
  • 1,774
  • 1
  • 20
  • 35