0
When you add the password and email value in the type of an input, the browser changes the background of this input to the yellow color and fills the user data automatically. Is there a way to prevent this event:
0
When you add the password and email value in the type of an input, the browser changes the background of this input to the yellow color and fills the user data automatically. Is there a way to prevent this event:
-1
This yellow color as far as I know the pattern of Chrome and you can remove it like this:
input:-webkit-autofill {
-webkit-box-shadow:0 0 0 1000px #fff inset; /* muda o background color */
-webkit-text-fill-color: #333; /* muda a cor do texto*/
}
input {
background-color: #fff;
color: #333;
}
About the autocomplete you can take the whole form
<form autocomplete="off">
...
</form>
Or direct in input
<input type="email" autocomplete="off">
About the <input type="password">
in it the autocomplete="off"
will not work for the Password because of a browser engine. Exestem other answers about it. One way to solve is by having 2 password fields. The first vc puts display:none
. The Browser in some This only fills the first password field, then the second that will be visible and will be empty...
OBS: You can also do a two-step validation like Google. First you ask for the email and do the validation, then in the next step you ask for the password. So the password field is not visible immediately face the user, and only appears after validating the email.
Browser other questions tagged html5
You are not signed in. Login or sign up in order to post.
This happens to all browsers or you are being specific to one only?
– Sam
No, the question was generic anyway
– Francis Vagner da Luz
I wonder if there’s any way to prevent it at all, if not, just google
– Francis Vagner da Luz
Francis you tested there, I managed to change the color?
– hugocsl
I switched, but it wasn’t quite what I thought was going to happen, it got a little weird yet, but I didn’t invest much time in the code. I think if I change some things it’ll get better.
– Francis Vagner da Luz
I tried to test site here, but I’m not getting it on my Chrome. Qq way qq problem tells me that I try to give you a strength
– hugocsl
So he changes the color, but I’m trying a rgba color on the background, but he won’t accept
– Francis Vagner da Luz
To avoid autocomplete, put it on the fields like this:
autocomplete="new-email"
andautocomplete="new-password"
– Sam
About the color tested so on the site of Santader! and it worked!
-webkit-box-shadow:0 0 0 1000px rgba(255,0,0,1) inset;
– hugocsl
The problem is that if you put a more neutral rgba, starting from the white color, for example, it seems that the transparency stays on a color and not on the background of my site.
– Francis Vagner da Luz
Francis I believe that’s because the yellow color is still there. what this style does and put an internal shade on the input, thus making an internal shade that sits on top of the standard color. Notice that it is a box-shadow
-webkit-box-shadow
You can try to put transparency in the input as a whole and not in the color with rgba to see how it looks...– hugocsl
Yes, then I will invest more in this solution... Thank you very much Hugo
– Francis Vagner da Luz