AngularJS材质设计:md-tabs中不同选项卡的不同颜色 [英] AngularJS Material Design : Different colors for different tabs in md-tabs
问题描述
是否可以为md-tabs
中的不同选项卡设置不同的背景颜色?
默认值为无颜色,如标签演示
Is there a way to set different background colors for different tabs in md-tabs
?
The default is no color as can be seen in tabs demo
我尝试了<md-tabs background-color="green">
,但是它不起作用
I tried <md-tabs background-color="green">
but it's not working
推荐答案
AngularJS材质设计(md)选项卡,md-tabs
背景色是透明的,并使用主容器的背景色.尝试为md-tabs
添加CSS类.
AngularJS Material design (md) tabs, md-tabs
background color is transparent and uses the background color of your main container. Try to add CSS class for md-tabs
.
为整个md标签添加了背景
Added background to entire md-tabs
md-tabs {
background: red;
border: 1px solid #e1e1e1; }
通过将CSS子级添加到md-tab类中,可以为不同的标签看到不同的颜色.
By adding CSS childs to md-tab class, you can see different colors for different tabs.
.md-tab:first-child{background: green; }
.md-tab:nth-child(2){background: pink; }
.md-tab:nth-child(3){background: blue; }
提琴 https://jsfiddle.net/cxf3otz9/
codepen http://codepen.io/anon/pen/zGNEyw
这篇关于AngularJS材质设计:md-tabs中不同选项卡的不同颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!