似乎無法使用 style= 和 css 更改它。這也是我的附加代碼
<div class="statusbar">
<mat-horizontal-stepper linear >
<mat-step label="One" [completed]="false"></mat-step>
<mat-step label="Two" [completed]="false" [editable]="false"></mat-step>
<mat-step label="Three"[completed]="false" [editable]="false"></mat-step>
<mat-step label="Four"[completed]="false" [editable]="false"></mat-step>
<mat-step label="Five"[completed]="false" [editable]="false"></mat-step>
<mat-step label="Six"[completed]="false" [editable]="false"></mat-step>
<mat-step label="Seven"[completed]="false" [editable]="false"></mat-step>
<mat-step label="Eight"[completed]="false" [editable]="false"></mat-step>
</mat-horizontal-stepper>
</div>
uj5u.com熱心網友回復:
第 1 步 - 添加ViewEncapsulation.None組件裝飾器。
import {Component, ViewEncapsulation} from '@angular/core';
@Component({
...
encapsulation: ViewEncapsulation.None
})
第 2 步 - 添加自定義 CSS。
.mat-step-header .mat-step-label .mat-step-text-label {
font-size: 24px;
color: red;
}
結果 -

uj5u.com熱心網友回復:
你可以試試下面:
.statusbar{font-size:50px}
uj5u.com熱心網友回復:
對我來說,這總是有效的:
::ng-deep .mat-step-text-label {
font-size: 0.9rem;
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/480865.html
