如何用我的图标填充页面的宽度?

问题描述 投票:0回答:1

我有一个带有以下代码的html页面:

<div class="container"
     fxLayout="row"
     fxLayout.sm="column"
     fxLayout.xs="column"
     fxLayoutAlign.gt-mat="space-around center"
     fxLayoutGap="10px"
     dir="rtl">

<div class="container"
fxLayout="column"
fxLayoutGap="10px"
dir="rtl">

  <div fxFlex>
    <div>
    <h3>در تمامی این بازار ها همراه شما هستیم</h3>
    <hr>
    </div>
  </div>

  <div fxFlex *ngIf="plans" [@expand]>
    <mat-grid-list cols="3" rowHeight="300px" >
    <mat-grid-tile *ngFor="let plan of plans" [routerLink]="['/plandetail', plan.id]" appHighlight>
      <img height="200px" src="{{BaseURL + plan.image}}" alt={{plan.name}}>
      <mat-grid-tile-footer>
        <h1 mat-line>{{plan.name | uppercase}}</h1>
      </mat-grid-tile-footer>
    </mat-grid-tile>
    </mat-grid-list>
  </div>
  <div [hidden]="plans || errMess">
    <mat-spinner></mat-spinner><h4>در حال بارگذاری ... </h4>
  </div>
  <div *ngIf="errMess">
    <h2>Error</h2>
    <h4>{{errMess}}</h4>
  </div>
</div>

看起来像这样:

enter image description here

但是我喜欢水平扩展以适应页面宽度。

html angular angular-material expand angular-flex-layout
1个回答
0
投票

尝试一下,您需要将行更改为列,如下所示:

<div class="container"
     fxLayout="column"
     fxLayout.sm="column"
     fxLayout.xs="column"
     fxLayoutAlign.gt-mat="space-around center"
     fxLayoutGap="10px"
     dir="rtl">

<div class="container"
fxLayout="column"
fxLayoutGap="10px"
dir="rtl">

  <div fxFlex>
    <div>
    <h3>در تمامی این بازار ها همراه شما هستیم</h3>
    <hr>
    </div>
  </div>

  <div fxFlex *ngIf="plans" [@expand]>
    <mat-grid-list cols="3" rowHeight="300px" >
    <mat-grid-tile *ngFor="let plan of plans" [routerLink]="['/plandetail', plan.id]" appHighlight>
      <img height="200px" src="{{BaseURL + plan.image}}" alt={{plan.name}}>
      <mat-grid-tile-footer>
        <h1 mat-line>{{plan.name | uppercase}}</h1>
      </mat-grid-tile-footer>
    </mat-grid-tile>
    </mat-grid-list>
  </div>
  <div [hidden]="plans || errMess">
    <mat-spinner></mat-spinner><h4>در حال بارگذاری ... </h4>
  </div>
  <div *ngIf="errMess">
    <h2>Error</h2>
    <h4>{{errMess}}</h4>
  </div>
</div>
© www.soinside.com 2019 - 2024. All rights reserved.