Skip to main content

angular material - How to change Divider color

app.component.ts

import { Component } from '@angular/core';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styles: [`
      .mat-divider {
        border-top-color: rgba(0,0,255,0.12);
      }
  `]
})


export class AppComponent { }
app.component.html

<h2 style="padding-top:25px; padding-bottom:25px;">
    Angular Material - How to change Divider color
</h2>


<h3>I am top</h3>
<mat-divider></mat-divider>

<h3>I am middle</h3>
<mat-divider></mat-divider>

<h3>I am bottom</h3>
app.module.ts [import]

import {MatDividerModule} from '@angular/material/divider'
More Angular tutorials