【发布时间】:2020-08-17 12:09:45
【问题描述】:
我正在使用 Flex Layout Angular,这很棒我已将 flex 添加到子组件<div fxFlex="100">,这使得 DIV 的宽度为 100%,但是,下面的组件宽度也是 100%。我不想对内部组件应用宽度。我怎样才能防止这种情况??
<div fxLayout="column" fxLayoutAlign="center center">
<mat-card>
<div fxLayout="row wrap" fxLayout.xs="column" fxLayoutGap="10px" fxLayoutAlign="center center">
<div fxFlex="100"> ==============================> added 100% width to the div, which is fine
<mat-form-field appearance="outline"> ==================> However, inner component is also added to 100% width it should be default
<mat-label>Make</mat-label>
<mat-select>
<mat-option>None</mat-option>
<mat-option *ngFor="let state of states" [value]="state">{{state}}</mat-option>
</mat-select>
</mat-form-field>
</div>
</div>
</mat-card>
</div>
【问题讨论】:
标签: html css angular flexbox angular-flex-layout