right alignment for a button in ion-col

Viewed 48030

I have this grid in my Ionic 2 application. Is there any ionic-specific attribute to make the button shown on the right side of the column (row)?

<ion-grid>
  <ion-row>
    <ion-col>col 1</ion-col>
    <ion-col>col 2</ion-col>
  </ion-row>
  <ion-row>
    <ion-col>
      <button ion-button>My button</button>
    </ion-col>
  </ion-row>
</ion-grid>
3 Answers

The accepted solution didnt work for me. I think it is relevant to ionic v3 and not the current. I solved my problem like this:

page.html:

<div class="test">
    <ion-button>My button</ion-button>
</div>

page.scss:

.test {
    float: right;
}

I'm using ionic 6.18.2 where this works for me:

<ion-button class="ion-float-right">Button Text</ion-button>
Related