This method has been successful for me. By using ui-tabview-selected
, the color of the selected tab can be changed effectively.
To add color to the remaining area, it is recommended to include ui-state-default.ui-state-active
in the background.
.ui-tabview .ui-tabview-nav li.ui-tabview-selected a {
background-color: rgb(57, 235, 175);
}
.ui-tabview .ui-tabview-nav li.ui-state-default.ui-state-active {
background: #f55555;
}
You may find helpful information by following this link:
Styling PrimeNG p-tabView, where I obtained some codes and made adjustments according to my requirements.
To gain a better understanding of
encapsulation: ViewEncapsulation.None
, you can refer to the explanation provided in this section.
Differences between ViewEncapsulation.Native, ViewEncapsulation.None, and ViewEncapsulation.Emulated