AngularJS Material Design:md-tabs 中不同标签的不同颜色 [英] AngularJS Material Design : Different colors for different tabs in md-tabs

查看:35
本文介绍了AngularJS Material Design:md-tabs 中不同标签的不同颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法为 md-tabs 中的不同标签设置不同的背景颜色?默认为无颜色,如

代码笔http://codepen.io/anon/pen/zGNEyw

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

I tried <md-tabs background-color="green"> but it's not working

解决方案

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 .

Added background to entire md-tabs

md-tabs {
    background: red;
    border: 1px solid #e1e1e1; }

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; } 

fiddle https://jsfiddle.net/cxf3otz9/

codepen http://codepen.io/anon/pen/zGNEyw

这篇关于AngularJS Material Design:md-tabs 中不同标签的不同颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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