Tampa
Tampa

Reputation: 78234

Use css to apply global style to material.angular mat-card to set background color

Trying to change the background of material.angular.io mat-card globally.

I added the below to styles.css and it does not work.

mat-card {
  background:pink
}

Upvotes: 2

Views: 7308

Answers (1)

Narm
Narm

Reputation: 10834

You just need to add a period in front of your css rule:

.mat-card {
    background: pink;
}

Here is a StackBlitz to play with it using a forked example from the Angular Material site.

Upvotes: 1

Related Questions