简体   繁体   中英

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.

Adding styles will align the items. You can use class to style or use inline styles as below.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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