首页 文章

在ngx-bootstrap中自定义选项卡

提问于
浏览
0

我正在尝试为ngx-bootstrap的标签添加自定义样式以获得角度 . 我想要两件事1)去除边框线和2)将背景颜色背景到活动标签 .

但似乎没有任何效果

HTML代码

div >
<tabset>
   <tab customClass="customClass" heading="Home"></tab>
   <tab heading="Profile"></tab>
   <tab heading="About us"></tab>
</tabset>
</div>

CSS代码

.customClass > a{
background-color:silver !important;
border-bottom: none !important;
outline: 0 !important; 
}

tab>active{
color:rgb(58, 45, 128)
}

可能是什么解决方案???

1 回答

  • 2

    尝试将 encapsulation: ViewEncapsulation.None 添加到组件元数据或使用 ::ng-deep 前缀

    ::ng-deep .customClass > a {
    }
    

    Stackblitz Example

相关问题