<ion-input class="text-input" id="p" type="tel" placeholder="输入手机号码" [(ngModel)]="phnNbr" clearInput></ion-input>
如上图,只需设置class="text-input",然后设置样式如下即可:
.text-input::-webkit-input-placeholder {
color: white;
}
.text-input:-ms-input-placeholder {
color: white;
}
.text-input::-moz-placeholder {
color: white;
}
.text-input:-moz-placeholder {
color: white;
}
本文介绍了如何在Ionic应用中自定义ion-input组件的placeholder颜色。通过添加"class=text-input"并设置相应的CSS样式,可以轻松改变placeholder的文字颜色。
1680

被折叠的 条评论
为什么被折叠?



