Is it possible to align the text a user types into an input?
for aesthetic reasons, I need it to appear in the center rather than on the left hand side, but the usual ‘text-align: center’ doesn’t seem to work with the ionic 2 component
thanks for everything
Take a look at the utility attrs for ionic2
1 Like
That did it thanks
I’d been using a div with onClick="this.contentEditable='true';"
, but that hadn’t worked quite how I wanted it to.
This is perfect!
Try this style.
ion-input{
.text-input{ text-align: center; }
}
It worked for me on Ionic 3.
Hope this will help you
2 Likes
In ionic 3 , try this :
<ion-input type=“text” placeholder=“Latitude” [value]=“lat” name=“latt” text-right #latt readonly>
only add : text-right or text-center or text-left in your ion-input
It works