2012-11-15 28 views
0
.txt1::-webkit-input-placeholder::before { 
     color:#c2c3c3; 
     content:"Hey Brad,\A Tell us what's on your mind"; 
    } 
    .txt1::-moz-input-placeholder::before { 
     color:#c2c3c3; 
     content:"Hey Brad,\A Tell us what's on your mind"; 
    } 

佔位符不工作的罰款佔位符在Firefox不工作的火狐,Chrome

回答

2

被刪除Webkit使用::-webkit-input-placeholder來定位佔位符文本:

.txt1::-webkit-input-placeholder:before { 
    color:#c2c3c3; 
    content:"Hey Brad,\A Tell us what's on your mind"; 
} 

雖然Firefox使用:-moz-placeholder爲目標的佔位符文本:

.txt1:-moz-placeholder:before { 
    color:#c2c3c3; 
    content:"Hey Brad,\A Tell us what's on your mind"; 
} 

您已經添加input Firefox的選擇,這是沒有必要的。您應該只在Firefox的選擇器開始處包含一個冒號,而不是兩個。我還建議在選擇器::before後刪除多餘的冒號,並將其更改爲:before,因爲這些是不必要的。使用我上面的代碼示例,你應該很好。希望這可以幫助!如果您有任何問題,請告訴我。

來源:https://developer.mozilla.org/en-US/docs/CSS/:-moz-placeholder

0

試試這個:

.txt1::-moz-placeholder::before { 
    color:#c2c3c3; 
    content:"Hey Brad,\A Tell us what's on your mind"; 
} 

我覺得沒有input-moz-input-placeholder

0

你爲什麼不能在input標籤添加佔位符?例如:

input type="" placeholder="any text"