简体   繁体   English

对齐中心离子中的元素

[英]Align elements in center ionic

I hava a code, inside it's a loop that output me a numbers.Something like this : 我有一个代码,它是一个循环中向我输出数字的代码。

<div *ngFor="let x of y.x" >

now the output is here : 现在输出在这里:

<h5 class="centeredX " *ngIf="x.link == ''">{{x.x}}<span *ngIf="x.isZ == 1"> <sup>3D</sup></span></h5>

So how can align on the same line all elements?My output is always something like this : 那么如何将所有元素对齐在同一行上呢?我的输出总是这样的:

1
2
3
4

I want this,also centerd in the middle of the page : 我想要这个,也居中于页面中间:

1 2 3 4

I used Ionic 2 and angular 2. 我使用了离子2和角2。

Adding styles will align the items. 添加样式将使项目对齐。 You can use class to style or use inline styles as below. 您可以使用class设置样式或使用内联样式,如下所示。

 <div *ngFor="let x of y.x" style:"display:inline-flex">
    ...
    </div>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM