我在离子中有这个html
<ion-label color="primary" stacked>Email</ion-label>
<ion-input type="email" placeholder="Email Input"></ion-input>
如何使文本输入在右侧对齐文本
ionic 3:
<ion-input text-center></ion-input>
每个ion-input
里面都有一个input
,这个输入是你需要设置的,只需执行以下操作:
ion-input {
input {
text-align: right;
/* IF YOU ALSO WANT TO PUSH PLACHEHOLDER TO THE RIGHT USE THE FOLLOWING, IF NOT JUST DELETE THE ::-webkit-input-placeholder*/
::-webkit-input-placeholder {
text-align: right;
}
}
}
希望这有帮助。
<div class="topPedding">
<ion-item>
<ion-input type="text" placeholder="Username" text-center></ion-input>
</ion-item>
<ion-item>
<ion-input type="password" placeholder="Password" text-center></ion-input>
</ion-item>
<ion-item class="border-none" lines="none">
<ion-toggle color="primary"></ion-toggle>
<ion-label>Rem[![enter image description here][1]][1]ember Password</ion-label>
</ion-item>
<ion-button color="light" expand="block">Sign In</ion-button>
</div>