Autofill usually changes the background color but in some areas, we don’t want that default color, so this script is to change the default color.
![](https://i0.wp.com/4.bp.blogspot.com/-2NzUVdiz3zs/XAX6M0rdsnI/AAAAAAAAD2A/f1Z-TxhRbyc50U7uOHqVkyTrJGntsmknQCLcBGAs/s640/Screenshot_3.png?w=1080&ssl=1)
Just add the following pseudo-selector to your style sheet and the background color will change according to your needs through ‘-webkit-box-shadow’.
This is
.headsearch__input:-webkit-autofill,
.headsearch__input:-webkit-autofill:hover,
.headsearch__input:-webkit-autofill:focus,
.headsearch__input:-webkit-autofill:active {
border: 1px solid #999;
-webkit-text-fill-color: #ffffff;
-webkit-box-shadow: 0 0 0px 1000px #151718 inset;
transition: background-color 5000s ease-in-out 0s;
}