Google Chrome表單自動填充及其黃色背景我對Google Chrome及其表單自動填充功能存在設(shè)計問題。如果Chrome記住某些登錄名/密碼,則會將背景顏色更改為黃色。以下是一些截圖:如何刪除該背景或只是禁用此自動填充?
3 回答

素胚勾勒不出你
TA貢獻(xiàn)1827條經(jīng)驗 獲得超9個贊
將“白色”更改為您想要的任何顏色。
input:-webkit-autofill { -webkit-box-shadow: 0 0 0 1000px white inset !important;}

牧羊人nacy
TA貢獻(xiàn)1862條經(jīng)驗 獲得超7個贊
如果你們想要透明的輸入字段,你可以使用轉(zhuǎn)換和轉(zhuǎn)換延遲。
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;}

溫溫醬
TA貢獻(xiàn)1752條經(jīng)驗 獲得超4個贊
解決方案在這里:
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); }); });}
添加回答
舉報
0/150
提交
取消