覆盖角垫选项卡的css
我想更改垫子标签的垫子标签颜色。我添加的css是:覆盖角垫选项卡的css,css,angular,angular-material,Css,Angular,Angular Material,我想更改垫子标签的垫子标签颜色。我添加的css是: .mat-tab-label { min-width: 25px !important; padding: 5px; background-color: transparent; color: white; opacity: 1 !important; font-weight: 700; } 它正在更改选项卡的颜色。但是,它正在改变整个应用程序中所有mat选项卡的颜色。如何单独更改特定选项卡。您可以使用组件标签 ap
.mat-tab-label {
min-width: 25px !important;
padding: 5px;
background-color: transparent;
color: white;
opacity: 1 !important;
font-weight: 700;
}
它正在更改选项卡的颜色。但是,它正在改变整个应用程序中所有mat选项卡的颜色。如何单独更改特定选项卡。您可以使用组件标签
app-component-name .mat-tab-label {
min-width: 25px !important;
padding: 5px;
background-color: transparent;
color: white;
opacity: 1 !important;
font-weight: 700;
}
或者将类添加到选项卡您必须在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:如果您在global style.css或scss中设置选项卡的样式,则所有选项卡的样式都将更改。您需要在要使用该样式的组件中添加一个用于隔离的文件。@anthonywillismuñoz您是对的。我在单个组件中添加了css。但是,它反映了allTry添加到style.css中,它将起作用@MaruthiErankiI移动到style.css,并将组件作为前缀添加到.mat选项卡标签。这解决了问题。