角材料展开面板在展开时失去背景

时间:2019-04-22 04:28:19

标签: css angular hover angular7

我在项目中使用了Angle 7和材质扩展面板。在css中,无论是否打开,我都更改了标题的颜色。当我展开面板时,悬停功能正在起作用,但是当我离开标题时,它失去了颜色。

之前

enter image description here

及之后

enter image description here

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>

谢谢

0 个答案:

没有答案