AngularJS材质设计:md-tabs中不同选项卡的不同颜色 [英] AngularJS Material Design : Different colors for different tabs in md-tabs

查看:153
本文介绍了AngularJS材质设计: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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆