【发布时间】:2020-11-06 03:26:03
【问题描述】:
我在对齐描述“摘要”时遇到问题,或者更具体地说,我想在面板右端的面板标题中显示我的项目编号。
这是我已经尝试过的:
.mat-expansion-panel-header-description {
flex-grow: 2;
text-align: end; /*also tried "right"*/
}
我也尝试将这些属性应用于我的摘要类,但没有任何效果,它们不会像我的屏幕截图中所示那样改变它们的位置
.summary {
text-align: right;
}
这是我的 html 标记:
<mat-expansion-panel class ="mat-header" hideToggle *ngFor="let key of itemCategories">
<mat-expansion-panel-header class="panel-header">
<mat-panel-title>
{{key}}
</mat-panel-title>
<mat-panel-description class="summary">
<div *ngIf="items[key].length > 0">
{{items[key].length}}
</div>
</mat-panel-description>
</mat-expansion-panel-header>
<div class="panel-content" *ngIf="items[key].length > 0">
<ng-container *ngFor="let item of items[key]">
<!-- Alle Bereiche -->
<!-- <ng-container *ngIf="key == 'Alle Bereiche'">
Alle Bereiche template
</ng-container> -->
<div>
Name: {{item?.name}} <br> Betrag: {{item?.price}} <hr>
</div>
</ng-container>
</div>
</mat-expansion-panel>
这是我的应用带有一些解释性标记的样子
https://snipboard.io/f1aQMi.jpg
无标记:
https://snipboard.io/f1aQMi.jpg
我想不通,这是我第一次使用 Angular 材料,有人可以告诉我我做错了什么吗?非常感谢任何帮助!
【问题讨论】:
标签: html css sass angular-material