谷歌浏览器自动填充导致输入框样式问题
css
谷歌浏览器自动填充导致输入框样式问题
text
1input:-webkit-autofill {
2 background-color: var(--color-fill-2) !important; /* 覆盖背景色,white 换成你页面背景色 */
3 -webkit-text-fill-color: #000 !important; /* 设置字体颜色 */
4 transition: background-color 5000s ease-in-out 0s; /* 避免闪烁 */
5}
6
7
8input:-webkit-autofill:hover {
9 background-color: var(--color-fill-3) !important; /* 覆盖背景色,white 换成你页面背景色 */
10 -webkit-text-fill-color: #000 !important; /* 设置字体颜色 */
11 transition: background-color 5000s ease-in-out 0s; /* 避免闪烁 */
12}
13
14input:-webkit-autofill:focus {
15 background-color: transparent !important; /* 覆盖背景色,white 换成你页面背景色 */
16 -webkit-text-fill-color: #000 !important; /* 设置字体颜色 */
17 transition: background-color 5000s ease-in-out 0s; /* 避免闪烁 */
18}