I have a login form with 2 fields, username and password. Username field is autocompleted by chrome. When I submit the form (when it is valid), this style is applied mysteriously:
input:-internal-autofill-selected {s ñ
background-color: rgb(232, 240, 254) !important;
background-image: none !important;
color: -internal-light-dark-color(black, white) !important;
}
Is there a way to avoid that? The form is submitted using Ajax, so it is a little ugly if for Username field that style is applied, but for Password field it is not.
I noticed that this happen only if field is filled with an element in the chrome sugggestions list. If field is filled with a value that is not in the list, the style is not applied.
Regards Jaime
Override the applied styles for that particular element. You can customize your bootstrap... To remove style you can use removeAttr property over the selector If you are not using inline style then you need to override the propeties in css The style is applied via css from the stylesheet, not inline.
If the “Styles” pane is open, you can also clear any applied style from there, as well. To open the pane, click the “Styles” pane launcher button in the “Styles” button group of the “Home” tab. Then select the text from which you want to remove the style in the document.
As you can see, when you’re styles aren’t “working like they’re supposed to” you don’t have to resort the !important tag. You have other options. In fact, it’s strongly recommended that you avoid using the !important tag in the vast majority of cases.
Hover the mouse pointer over a style name in the Styles window. You should see a down-arrow appear at the right side of the style name. Click the down arrow and select Modify.
To get rid of the undesired behavior, this trick "just works" (tm):
input:-webkit-autofill,
input:-webkit-autofill:focus {
transition: background-color 600000s 0s, color 600000s 0s;
}
You can add a box-shadow to remove the blue background
box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0), inset 0 0 0 100px rgba(255, 255, 255,1);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With