How to change the style of :-webkit-autofill?

我只是一个虾纸丫 提交于 2021-02-05 06:37:24

问题


The default background-color of the :-webkit-autofill is orange. How to change it?

:-webkit-autofill, input:-webkit-autofill {
    background-color: #fff !important;
}

The above code doesn't work.


回答1:


It's not background-color that gets rid of that yellow/orange, it's the box-shadow:

input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 100px #fff inset;
    -moz-box-shadow: 0 0 0 100px #fff inset;
    box-shadow: 0 0 0 100px #fff inset;
}


来源:https://stackoverflow.com/questions/29773268/how-to-change-the-style-of-webkit-autofill

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!