最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

margin - How to center ion-grid in ion-content? - Stack Overflow

programmeradmin0浏览0评论

In a site with using CDN version of Ionic I got a problem.

I have the following working :

<ion-grid>
  <ion-row >
    <ion-col>
      ABC 
    </ion-col>
    <ion-col>
      XYZ
    </ion-col>
  </ion-row>
</ion-grid>

The grid is in the middle (horizontally).

But when I add ion-content around this part, The grid if fully aligned over the screen horizontally.

<ion-content>
<ion-grid>
  <ion-row >
    <ion-col>
      ABC 
    </ion-col>
    <ion-col>
      XYZ
    </ion-col>
  </ion-row>
</ion-grid>
</ion-content>

I have tried adding style="inline-margin: auto;" to ion-grid.

But that did not work. In the browser tools I see that, "inline-margin: auto;" disappeared when adding ion-content.

Anyone who knows what the reason is, and how to make te same centering of content possible with ion-content ?

发布评论

评论列表(0)

  1. 暂无评论