Indra suandi
Indra suandi

Reputation: 161

align-text in ion-input Ionic 2

I have this html in ionic

<ion-label color="primary" stacked>Email</ion-label>
<ion-input type="email" placeholder="Email Input"></ion-input>

how to make text input align-text in right side

Upvotes: 3

Views: 12599

Answers (3)

Abdullah
Abdullah

Reputation: 2973

<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>

Upvotes: 0

Hizabr
Hizabr

Reputation: 461

ionic 3:

<ion-input text-center></ion-input>

Upvotes: 13

Gabriel Barreto
Gabriel Barreto

Reputation: 6421

Inside of every ion-input there's a input, this input is what you need to style, just do the following:

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;
    }
  }
}

Hope this helps.

Upvotes: 10

Related Questions