
方法一:
因?yàn)檫@玩意出現(xiàn)只有在之前有輸入記錄的情況下才會出現(xiàn)的,所以只有禁用input的記錄就能ok!
比如:<input type="text" ?autocomplete="off">,如此當(dāng)你點(diǎn)擊了input時(shí)它就不會有那一列表了!整個(gè)世界也就干凈了!當(dāng)然,如果你能忍受那屎黃色,也可以把它給“on”了,或者不設(shè)置,因?yàn)閍utocomplet默認(rèn)就是'on'的!
不過,很多時(shí)候可能需求不允許你去掉簡單方便的記錄!那可咋整?
于是,
方法二:
-webkit-box-shadow: 0 0 0px?1000px?white?inset沒錯(cuò),就是給input設(shè)置內(nèi)置陰影!而且一定要大,至少要比你的input本身大!不過,box-shadow是很慢的!而且,如果你的input是用圖片做背景的話,是沒有辦法做這么干的!
input:-webkit-autofill {
?????-webkit-box-shadow: 0 0 0px 1000px white inset;
?????-webkit-text-fill-color:?#333;
}
所以
方法三:
是通過延長增加自動填充背景色的方式, 是用戶感受不到樣式的變化
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
?????-webkit-transition-delay: 99999s;
?????-webkit-transition: color 99999s ease-out, background-color 99999s ease-out;
}
由于我這里輸入框是圖片做背景,選擇第二種并沒有效果,所以選擇第三種。
完美解決!