css - 如何在angular 6中的prime-ng tabview选项卡中添加样式?

标签 css angular primeng ng-bootstrap

我正在使用prime-ng tabView并且当前的tabview是这样的
enter image description here

我想为tabView实现以下类型的标签。
enter image description here

有没有办法做到这一点?

基本的p-tabview实现是这样的。

<p-tabView [(activeIndex)]="currentTab">
        <p-tabPanel header="Tab1"  ></p-tabPanel>
        <p-tabPanel header="Tab2"  ></p-tabPanel>
        <p-tabPanel header="Tab3"  ></p-tabPanel>
        <p-tabPanel header="Tab4"  ></p-tabPanel>
        <p-tabPanel header="Tab5"  ></p-tabPanel>
</p-tabView>

最佳答案

您好,我在html CSS中开发了此箭头标签视图,

Angular Project github



.container{
    display: flex;
}
.main-div1{
    position: relative;
    height: 60px;
    background: #009688;
    width: 89px;
    left: 107px;
    color: white;
    margin-right: 75px;
    text-align: center;
    line-height: 60px;
}
.main-div1:before{
    content: "";
    position: absolute;
    top: 0px;
    left: -49px;
    border-style: solid;
    border-width: 30px 0px 30px 34px;
    border-color: #009688 transparent;
    display: block;
    width: 0;
    width: 15px;
    z-index: 0;
    height: 0px;    
  }

  .main-div1::after{
    content: "";
    position: absolute;
    top: 0px;
    left: 89px;
    border-style: solid;
    border-width: 30px 0px 30px 34px;
    border-color:transparent #009688;
    display: block;
    width: 0;
    width: 15px;
    z-index: 0;
    height: 0px;    
  }

  .main-div2{
    position: relative;
    height: 60px;
    background: #009688;
    width: 89px;
    left: 107px;
    color: white;
    margin-right: 75px;
    text-align: center;
    line-height: 60px;
}
.main-div2:before{
    content: "";
    position: absolute;
    top: 0px;
    left: -49px;
    border-style: solid;
    border-width: 30px 0px 30px 34px;
    border-color: #009688 transparent;
    display: block;
    width: 0;
    width: 15px;
    z-index: 0;
    height: 0px;    
  }

  .main-div2::after{
    content: "";
    position: absolute;
    top: 0px;
    left: 89px;
    border-style: solid;
    border-width: 30px 0px 30px 34px;
    border-color:transparent #009688;
    display: block;
    width: 0;
    width: 15px;
    z-index: 0;
    height: 0px;    
  }

  .main-div3{
    position: relative;
    height: 60px;
    background: #009688;
    width: 89px;
    left: 107px;
    color: white;
    margin-right: 75px;
    text-align: center;
    line-height: 60px;
}
.main-div3:before{
    content: "";
    position: absolute;
    top: 0px;
    left: -49px;
    border-style: solid;
    border-width: 30px 0px 30px 34px;
    border-color: #009688 transparent;
    display: block;
    width: 0;
    width: 15px;
    z-index: 0;
    height: 0px;    
  }

  .main-div3::after{
    content: "";
    position: absolute;
    top: 0px;
    left: 89px;
    border-style: solid;
    border-width: 30px 0px 30px 34px;
    border-color:transparent #009688;
    display: block;
    width: 0;
    width: 15px;
    z-index: 0;
    height: 0px;    
  }

<div class="container">
  <div class="main-div1"> Booked</div>
  <div class="main-div2"> Ready Ship</div>
  <div class="main-div3"> Scheduled</div>
</div>





] 1

关于css - 如何在angular 6中的prime-ng tabview选项卡中添加样式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57196479/

相关文章:

html - 将图像添加到 Bootstrap Navbar 链接

javascript - 使用 JavaScript 使用递归函数遍历 JSON 字符串到内部级别

angular - 如何将多个值传递给 angular 5 observable?

html - CSS 3 : Correct "transition-property" for translate operation

javascript - Jquery Tab 不适用于 Firefox 和 chrome。同样适用于 IE 9

chart.js - 如何在chartJS中制作虚线或虚线?

angular - PrimeNg - 使动态创建的对话框可拖动

javascript - 在 PrimeNG 中扩展多个面板时如何修复损坏?

css - 图片掉出一行

json - 使用 Angular http 请求 json 文件时出现 404