[英]Change background color for Angular Material mat-select component
我正在尝试更改 Angular Material mat-select
组件中的背景颜色。 我尝试将相同的 class 添加到所有标签class="bg"
:
.bg {
background: #fff !important;
}
::ng-deep .bg {
background: #fff !important;
}
Select ::ng-deep element ::ng-deep .bg {
background: #fff !important;
}
Select::ng-deep .bg {
background: #fff !important;
}
但是组件的某些部分看起来像透明的背景颜色:
<mat-form-field class="bg">
<mat-select class="bg">
<mat-option
class="bg"
*ngFor="let dt of data"
[value]="dt.value"
>
{{ dt.myValue }}
</mat-option>
</mat-select>
</mat-form-field>
我正在尝试更改 Angular Material mat-select
组件中的背景颜色。 我尝试将相同的 class 添加到所有标签class="bg"
:
.bg {
background: #fff !important;
}
::ng-deep .bg {
background: #fff !important;
}
Select ::ng-deep element ::ng-deep .bg {
background: #fff !important;
}
Select::ng-deep .bg {
background: #fff !important;
}
但是组件的某些部分看起来像透明的背景颜色:
<mat-form-field class="bg">
<mat-select class="bg">
<mat-option
class="bg"
*ngFor="let dt of data"
[value]="dt.value"
>
{{ dt.myValue }}
</mat-option>
</mat-select>
</mat-form-field>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.