首页 > 解决方案 > 如何改变垫标签的颜色

问题描述

我需要改变我的垫子标签的颜色。但是当我尝试!important在 scss 中更改颜色时,我的输入出现错误......颜色不会恢复为红色。

如果我没有收到错误,我只需要更改标签的颜色,如果我收到错误,它应该留下红色。

<mat-form-field floatLabel="always" appearance="none">
  <mat-label>Usuário</mat-label>
  <input autofocus matInput formControlName="j_username">
</mat-form-field>

标签: htmlangularfrontend

解决方案


只需在 scss 中更改您喜欢的颜色

mat-label {
color: red;
}

推荐阅读