0

How to set something to be in center horizontally and bottom vertically?

I tried to use flex as class="layout horizontal" like in Polymer...

<ion-content class="layout vertical">
  <span class="flex"></span>
<button danger round class="center">Hibás</button>
</ion-content>
Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567
MegaX
  • 596
  • 2
  • 11
  • 23

2 Answers2

3

It is a question of style (CSS) rather than framework (Ionic) I use the following which works well.

<ion-content padding class="">

  <p>Some content</p>

  <div class="bottom" text-center>
    <button block>Submit</button> 
  </div>

</ion-content>

And in my style sheet (app/theme/app.core.scss):

.bottom {
  padding: $content-padding;
  position: fixed;
  bottom:0;
  left: 0;
  right: 0;
}
shenku
  • 11,969
  • 12
  • 64
  • 118
0

Not really an Ionic2 question, more CSS styling issue.

Try something similar to trying to align html button at the center of the my page

Wulf Solter
  • 717
  • 6
  • 19