【发布时间】:2016-09-20 09:50:36
【问题描述】:
我尝试为我的 Angular Material 应用程序开发以下用户界面。但我不知道如何在 CSS 中自定义所有未选中的 md-tabs。
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中的一个版本jsfiddle.net/mueller92/c9w521ka
标签: javascript html css angularjs angular-material