2
我嘗試爲我的角度材質應用開發以下用戶界面。但我不知道如何定製CSS中所有未選定的md選項卡。從md-tab自定義未選擇的md-tab-label的樣式
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;
}
你可以在jsfiddle.net運行代碼 –
這是JSFiddle的一個版本https://jsfiddle.net/mueller92/c9w521ka/ –