Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ionic item with left and right aligned text

I have an ionic item in an ionic list. What is the best way to left align the first text and right align the second text?

  <div class="item">
    <span>first</span>
    <span>second</span>
  </div>
like image 624
user1283776 Avatar asked Nov 19 '15 11:11

user1283776


People also ask

Which element is used to align the text to both the right and left margins of the text box?

Horizontal alignment determines how the left and right edges of a paragraph fit between the margins, while vertical alignment determines the placement of the text between the upper and lower margins.

How do you give a space between an icon and text in ionic?

You can add &nbsp; between the two buttons. Save this answer.

What aligns the text in an element?

The text-align property specifies the horizontal alignment of text in an element.


1 Answers

I use Ionic 3 and the best anwser I think is to use the ionic tags and attributes:

<ion-list>
  <ion-item>
    <ion-label>
      this to the left
    </ion-label>
    <ion-label text-right>
      this to the right
    </ion-label>
  </ion-item>
</ion-list>
like image 198
Ari Waisberg Avatar answered Dec 25 '22 11:12

Ari Waisberg