Align text right Html Ionic

Nestoraj picture Nestoraj · Sep 14, 2015 · Viewed 17k times · Source

I'm trying to align text in Html but it doesn't work and I do not know why. I'm using Ionic Framework.

My code is:

<ion-list>
   <ion-item>
      <b>Name</b> <p align="right"> {{paciente.name}}</p>
   </ion-item>
   ....
</ion-list>

and it looks like this: enter image description here

but I want all text int the same line, and I do not know how to get that.

Answer

Mudasser Ajaz picture Mudasser Ajaz · Sep 14, 2015

See this demo: http://play.ionic.io/app/b477ea2f5623
In ionic items, if you write any text within span with item-note class then it will be aligned to right.This is built in class by ionic, your code will be like this :

<ion-item>
  <b>Name</b> <span class="item-note"> {{paciente.name}}</span>
</ion-item>

See more tricks with ionic items provide by built in classes, see this Documentation