input text background color is set as yellow, only in chrome. How to remove this color?
I already tried to set background-color and everything but is still yellow
input text background color is set as yellow, only in chrome. How to remove this color?
I already tried to set background-color and everything but is still yellow
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;
}
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;
}
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');