MadPhysicist
MadPhysicist

Reputation: 5831

Getting Rid of Yellow Fill On Input After Email Auto-Fill From Chrome

I have a simple username-password form set up with some styles applied to it. It works great. The problem comes when I login more than one time.

Namely, since Chrome recognizes my email, it tries to auto-fill it. If I oblige, the username textbox acquires a repulsive yellow color. See images below for screenshots.

How can I stop this from happening? I have not tested thoroughly, but it seems that neither Firefox nor Safari has this issue.

Empty form

After auto-fill has occurred.

Upvotes: 1

Views: 256

Answers (1)

Ismail RBOUH
Ismail RBOUH

Reputation: 10450

You can use :-webkit-autofill CSS pseudo-class, it matches when an element has its value autofilled by the browser.

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

Upvotes: 4

Related Questions