【问题标题】:How to move a button to "center-bottom" in ionic2如何在ionic2中将按钮移动到“中心底部”
【发布时间】:2016-02-24 06:09:40
【问题描述】:

如何设置东西水平居中垂直底部?

我尝试像在 Polymer 中一样将 flex 用作 class="layout horizontal"...

<ion-content class="layout vertical">
  <span class="flex"></span>
<button danger round class="center">Hibás</button>
</ion-content>

【问题讨论】:

    标签: css


    【解决方案1】:

    不是真正的 Ionic2 问题,更多的是 CSS 样式问题。

    试试类似trying to align html button at the center of the my page的东西

    【讨论】:

      【解决方案2】:

      这是样式(CSS)而不是框架(Ionic)的问题,我使用以下效果很好。

      <ion-content padding class="">
      
        <p>Some content</p>
      
        <div class="bottom" text-center>
          <button block>Submit</button> 
        </div>
      
      </ion-content>
      

      在我的样式表中(app/theme/app.core.scss):

      .bottom {
        padding: $content-padding;
        position: fixed;
        bottom:0;
        left: 0;
        right: 0;
      }
      

      【讨论】:

        猜你喜欢
        • 2021-01-21
        • 1970-01-01
        • 1970-01-01
        • 2019-11-26
        • 1970-01-01
        • 2011-10-14
        • 1970-01-01
        • 2015-01-27
        • 1970-01-01
        相关资源
        最近更新 更多