html – How can you defeat input: -webkit-autofill?

Question:

The default chrome style does not allow changing the background of an auto-filled field. What is this snag, maybe who knows?

Answer:

You will not be able to redefine it, because this thing is sewn. I used a CSS hack like this:

.some_input{
    -webkit-box-shadow: inset 0 0 0 50px #fff;
    -webkit-text-fill-color: #000;
}

those. overlay the background with an inner shadow.

Scroll to Top