<ion-input placeholder="please input" clearInput></ion-input>
如何在離子輸入中更改佔位符的顏色?
我想改變佔位符的顏色,並且不應該影響其他頁面。
<ion-input placeholder="please input" clearInput></ion-input>
如何在離子輸入中更改佔位符的顏色?
我想改變佔位符的顏色,並且不應該影響其他頁面。
離子輸入給一個類別名稱:
<ion-input class="text-input" placeholder="please input" clearInput></ion-input>
,並添加以下行到你的頁面的.scss文件:
.text-input::-moz-placeholder {
color: red;
}
.text-input:-ms-input-placeholder {
color: red;
}
.text-input::-webkit-input-placeholder {
color: red;
}
雖然通過99tharun作品,電流離子答案(離子-angular 3.8.0)提供了通過主題變量實現的標準方式。 見ionic documentation for the input field page, SASS variables section。通知$text-input-placeholder-color
變量。
不錯,謝謝。 – David
很好,這個答案應該被接受爲corretc – user1195369