代码之家  ›  专栏  ›  技术社区  ›  San Jaisy

为ngb选项卡集创建自定义CSS设计

  •  0
  • San Jaisy  · 技术社区  · 7 年前

    我正在尝试为ngb选项卡集创建自定义设计

    custom css

    下面是html代码

     <ngb-tabset>
              <ngb-tab>
                  <ng-template ngbTabTitle><span class="tab-title">All Professional Learnings</span></ng-template>
                  <ng-template ngbTabContent>
                      <app-all-professional-learnings></app-all-professional-learnings>
                  </ng-template>
              </ngb-tab>
              <ngb-tab>
                  <ng-template ngbTabTitle><span class="tab-title">My Professional Learnings</span></ng-template>
                  <ng-template ngbTabContent>
                      <app-my-professional-learnings></app-my-professional-learnings>
                  </ng-template>
              </ngb-tab>
          </ngb-tabset>
    

    我试过的一些css

    .nav-link.active, .nav-pills .show > .nav-link {
      background-color: transparent !important;
      color: $primary !important;
      border-radius: 0;
      border-bottom: 3px solid;
      padding-bottom: 2px;
      border-color: #dee2e6 #dee2e6 $primary !important;
    }
    .nav-link {
      margin-bottom: 25px !important;
      color: $primary !important;
      border-left: 0px solid !important;
      border-right: 0px solid !important;
      border-top: 0px solid !important;
    }
    .nav-tabs{
      border-bottom: 0 !important;
    }
    

    my design

    有人能告诉我如何设计上面的标签吗

    2 回复  |  直到 7 年前
        1
  •  2
  •   M M    7 年前

    试试这个。它应该会起作用。

    .nav-link.active, .nav-pills .show > .nav-link {
      background-color: #CD853F !important;
      color: white !important;
      border-radius: 0;
      border: 3px solid #CD853F;
      padding-bottom: 2px;      
    }
    .nav-link {
      margin-bottom: 25px !important;
      color: #CD853F !important;
      border: 3px solid #CD853F !important;      
    }
    .nav-tabs{
      border-bottom: 0 !important;
    }
    

    我不确定您使用的变量,所以我用十六进制值替换它们。

        2
  •  0
  •   San Jaisy    7 年前

    @M解决方案的一些变化

    .nav-link.active, .nav-pills .show > .nav-link {
      background-color: $primary !important;
      color: white !important;
      border-radius: 0;
      border-bottom: 3px solid $primary;
      padding-bottom: 2px;
    }
    .nav-link {
      margin-bottom: 25px !important;
      color: $primary !important;
      border: 3px solid $primary !important;   
    }
    .nav-tabs .nav-link{
      border-top-left-radius: 0rem;
        border-top-right-radius: 0rem;
    }
    .nav-tabs .nav-link.active {
      border: 6px solid #9f8148 !important;
    }
    
    推荐文章