在选择时更改标签文字颜色 [英] Changing tab text color on selection
本文介绍了在选择时更改标签文字颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用Angular4,并且一直在使用角度材料.我已经创建了一个标签组,并且在选择任何标签时都想更改标签标签的文本颜色.我试图覆盖默认的CSS,但这对我没有帮助.
I am working on Angular4 and have been using angular material. I have created a tab-group and I want to change the text color of a tab label when I select any tab. I have tried to override the default css but that didn't help me.
我可以覆盖墨水栏,但是选择时不能覆盖标签文本颜色
I can override the ink bar but I am not able to override tab-text color upon selection
.mat-ink-bar{
background-color:#00ADEE;
}
/*.mat-tab-label::selection{
color: #00ADEE !important;
} */
我试图更改tab-label-color的颜色的注释部分.
The commented part which I was trying to change the color of a tab-label-color.
推荐答案
您需要对活动标签使用以下类:
You need to use the following class for active tab:
.mat-tab-label-active {
color: #00ADEE !important;
}
这里是
这篇关于在选择时更改标签文字颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文