2015-06-20 82 views
0

在閱讀之前,請注意這不是一個複製,爲什麼?因爲答案從來沒有好的答案,我們需要的答案。在谷歌瀏覽器中使自動完成輸入透明

所以,我們基本上想要做的,就是讓一個輸入透明的,就像這樣:

A example of transparent background in a input

這是美麗的,不是嗎?好了,現在看看這個:

A not beautiful input at all

這只是看...太可怕了。 有沒有辦法解決這個問題?

如下的東西不起作用:

input:-webkit-autofill { 
    -webkit-box-shadow: 0 0 0px 1000px rgba(255, 255, 255, 0.3) inset; 
    -webkit-text-fill-color: #EEEEEE !important; 
} 

的想法?

+0

背景顏色:透明,你可以做一個小提琴 –

+0

對不起,這些東西不適用於瀏覽器特定的選擇器 –

+0

我喜歡這個問題的解決方案由傑森http://stackoverflow.com/questions/2920306/google-chrome-form-autofill-and-its-yellow-background – user2867288

回答

0

這是WebKit的自動填充

input:-webkit-autofill { 
    -webkit-box-shadow:0 0 0 50px white inset; 
} 

改變白到任何你想要的。

而且 - 如果你想改變文字顏色是:

-webkit-text-fill-color: yourColor !important; 

如果你不想使用此解決方案,您可以使用類似這樣

input { 
    background-color: red !important; 
} 

看到這裏全信息 - http://labs.enonic.com/articles/remove-forced-yellow-input-background-in-chrome

但大多數建議是使用

input:-webkit-autofill { 
-webkit-box-shadow:0 0 0 50px white inset; 
} 
+0

你好,我沒有把這個問題標記爲OK,因爲它沒有使輸入透明:) –

+0

@TijlVandenBrugghen輸入:-webkit-autofill {color:rgba (255,255,255,0.3)!重要; } – ajmajmajma