我想要更改垫标签的颜色。我添加的css是:
.mat-tab-label {
min-width: 25px !important;
padding: 5px;
background-color: transparent;
color: white;
opacity: 1 !important;
font-weight: 700;
}它正在更改选项卡的颜色。但是,在整个应用程序中,它正在改变所有mat-tab的颜色。如何才能单独更改特定的选项卡。
发布于 2020-07-09 16:47:29
您可以使用元件标记标签,
app-component-name .mat-tab-label {
min-width: 25px !important;
padding: 5px;
background-color: transparent;
color: white;
opacity: 1 !important;
font-weight: 700;
}或者向选项卡中添加一个类
发布于 2020-07-09 16:51:05
您必须覆盖style.css或style.scss中的类样式
.mat-tab-label {
min-width: 25px !important;
padding: 10px;
background-color: transparent;
color: white;
opacity: 1 !important;
font-weight: 700;
}Stackblitz:https://stackblitz.com/edit/angular-mat-tab-active-89vnui
https://stackoverflow.com/questions/62810892
复制相似问题