【发布时间】:2016-01-08 12:44:06
【问题描述】:
有什么方法可以在输入自动填充时设置背景图像?我需要跨浏览器版本和移动版本。
我找到了一些答案,但没有什么真正适合我,请参阅 Add background image to input fields with Autofill in mobile browsers - default yellow background removes them 或 Chrome hiding background image with autofills
这是我的选择
background-image: url(img.png);
对于 select:-webkit-autofill 我得到了相同的代码
background-image: url(img.png) !important;
但在自动填充时,我得到默认外观,黄色背景......但如果我查看用户代理样式,背景图像:无;被我的图像覆盖。 我试图设置背景:透明;用于选择,但没有任何效果。
【问题讨论】:
-
感谢您的回答,但它不适用于自动填充。我编辑了我原来的帖子。我得到了带有黄色背景且没有图像的默认外观。
标签: css input autocomplete autofill