我在项目中使用了Angle 7和材质扩展面板。在css中,无论是否打开,我都更改了标题的颜色。当我展开面板时,悬停功能正在起作用,但是当我离开标题时,它失去了颜色。
之前
及之后
css
.mat-expansion-panel-header::after {
padding: 10;
background-color:#E03616;
color:white;
text-align: left;
}
.mat-expansion-panel-header {
padding: 10;
background-color:#E03616;
color:white;
text-align: left;
}
.disable_ripple:hover{
background: #E03616 !important;
}
html
<mat-expansion-panel>
<mat-expansion-panel-header class='disable_ripple .disable_ripple_a'>
Test Exams
</mat-expansion-panel-header>
<div *ngFor='let c of noCases; let j = index' style="padding:1em;" class="main-div">
<button mat-raised-button (click)='examselected(c.examid)' color='primary'>Exam {{j+1}}</button>
</div>
</mat-expansion-panel>
谢谢