2016-05-23 79 views
2

我嘗試爲我的角度材質應用開發以下用戶界面。但我不知道如何定製CSS中所有未選定的md選項卡。從md-tab自定義未選擇的md-tab-label的樣式

This is what I want to have.

Current version

HTML代碼:

 <md-tabs class="md-primary" md-selected="selectedIndex" md-align-tabs="top" md-autoselect md-dynamic-height id="top"> 
      <md-tab ng-repeat="tab in tabs" flex layout="column" layout-fill> 
       <md-tab-label> 
        <div layout="row" layout-fill> 
         <div class="md-tab-item-index"> 
          <span>{{tab.index}}</span> 
         </div> 
         <div class="md-tab-item-label"> 
          {{tab.title}} 
         </div> 
         <div class="md-tab-item-label-separator"></div> 
        </div> 
       </md-tab-label> 
       <md-tab-body> 
        <div ng-include="tab.content"></div> 
       </md-tab-body> 
      </md-tab> 
     </md-tabs> 

CSS

.md-tab-item-label { 
    color: white; 
    font-size: 14px; 
    line-height: 20px; 
    text-transform: capitalize; 
} 

.md-tab-item-label-separator { 
    background-color: rgba(255, 255, 255, 0.5); 
    -webkit-box-flex: 0 1 auto; 
    -webkit-flex: 0 1 auto; 
    flex: 0 1 auto; 
    height: 1px; 
    min-width: 0; 
    position: relative; 
    top: 12px; 
    width: 68px; 
    margin-left: 10px; 
} 

.md-tab-item-index { 
    background-color: #ffffff; 
    -webkit-border-radius: 50%; 
    border-radius: 50%; 
    -webkit-box-flex: 0 0 auto; 
    -webkit-flex: 0 0 auto; 
    flex: 0 0 auto; 
    font-size: 12px; 
    font-weight: 500; 
    height: 24px; 
    line-height: 24px; 
    position: relative; 
    text-align: center; 
    width: 24px; 
    color: #000000; 
    margin-right: 10px; 
} 
+0

你可以在jsfiddle.net運行代碼 –

+0

這是JSFiddle的一個版本https://jsfiddle.net/mueller92/c9w521ka/ –

回答

0

簡單:

md-tab ng-scope ng-isolate-scope md-ink-ripple md-active 這就是積極的一個

md-tab ng-scope ng-isolate-scope md-ink-ripple 那不是一個活躍

用你的風格給所有,然後準備獨特的風格活躍之一。

+0

我試過你的解決方案,但它不起作用。 你能在小提琴中實現你的解決方案嗎? jsfiddle.net/mueller92/c9w521ka –