Google Chrome表单自动填充及其黄色背景

Google Chrome表单自动填充及其黄色背景

我对Google Chrome及其表单自动填充功能存在设计问题。如果Chrome记住某些登录名/密码,则会将背景颜色更改为黄色。

以下是一些截图:

如何删除该背景或只是禁用此自动填充?


哆啦的时光机
浏览 605回答 3
3回答

素胚勾勒不出你

将“白色”更改为您想要的任何颜色。input:-webkit-autofill {     -webkit-box-shadow: 0 0 0 1000px white inset !important;}

牧羊人nacy

如果你们想要透明的输入字段,你可以使用转换和转换延迟。input:-webkit-autofill,input:-webkit-autofill:hover,input:-webkit-autofill:focus,input:-webkit-autofill:active {     -webkit-transition-delay: 9999s;     -webkit-transition: color 9999s ease-out, background-color 9999s ease-out;}

温温酱

解决方案在这里:if (navigator.userAgent.toLowerCase().indexOf("chrome") >= 0) {     $(window).load(function(){         $('input:-webkit-autofill').each(function(){             var text = $(this).val();             var name = $(this).attr('name');             $(this).after(this.outerHTML).remove();             $('input[name=' + name + ']').val(text);         });     });}
打开App,查看更多内容
随时随地看视频慕课网APP