Chrome :-internal-autofill-selected overwrite

Viewed 46

How can I (with css) overwrite Chrome's default class for input:-internal-autofill-selected ?

Using body input:-internal-autofill-selected does display as being used, but the <input is still actually white instead of pink...

body input:-internal-autofill-selected {
    background-color: pink !important;
}

This is how it looks in chrome, but as stated the background-color is still white

enter image description here

1 Answers

from your question i'm not 100% sure what you're trying to achieve, set the color to the one you prefer or to get rid of the default blue background perhaps?

if you're trying to change the color to custom one you can add this declaration to your CSS rule:

box-shadow: 0 0 0 1000px pink inset;

the solution below worked for me to get rid of default blue background instead of trying to overwrite it to white using background color property.

-webkit-background-clip: text;
background-clip: text;
Related