how to use different background color for two p-card?

UI Components for Angular
Post Reply
accsoar
Posts: 1
Joined: 01 Nov 2019, 12:23

01 Nov 2019, 12:29

I have two p-card in a component. I hope them have different background colors.

I used the following CSS code but this makes two p-card have same background color.

::ng-deep .ui-card {
background-color: lightblue !important;
}

Is it possible to make two p-card have different colors?

Thanks!

yigitfindikli
Posts: 358
Joined: 08 Aug 2018, 14:09

04 Nov 2019, 10:58

accsoar wrote:
01 Nov 2019, 12:29
I have two p-card in a component. I hope them have different background colors.

I used the following CSS code but this makes two p-card have same background color.

::ng-deep .ui-card {
background-color: lightblue !important;
}

Is it possible to make two p-card have different colors?

Thanks!
Hi,
Can you try 'ViewEncapsulation.None' like this;

Code: Select all

@Component({
    	...
	encapsulation: ViewEncapsulation.None
})

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests