如何覆盖角度2的材质样式? [英] How to overwrite angular 2 material styles?
本文介绍了如何覆盖角度2的材质样式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在棱角材质中有此选择:
I have this select in angular material:
其代码:
<md-select placeholder="Descuentos y convenios" [(ngModel)]="passenger.discount">
<md-option [value]="null" [disabled]="true">
Descuentos
</md-option>
<md-option *ngFor="let option of discounts" [value]="option">
{{ option }}
</md-option>
<md-option [value]="null" [disabled]="true">
Convenios
</md-option>
<md-option *ngFor="let option of agreements" [value]="option">
{{ option }}
</md-option>
</md-select>
我想添加以下样式:
我试图在md-select和md-option上放置一些类,但是没有用. 我想举一个例子,说明如何设置背景颜色或边框,这将给我一个思路.
I tried to put some classes over md-select and md-option, but not worked. I would like to have maybe just an example of how to put the background color or the border and that would give me an idea.
提前谢谢
推荐答案
I think classes should work, but you may need to use /deep/ because of the view encapsulation.
尝试一下:
/deep/ md-select.your-class {
background-color: blue;
}
您还可以使用主题.
这篇关于如何覆盖角度2的材质样式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文