Hello, guys.
I'm trying to change the style of my p-dropdown element and I´m facing some problems.
Project Version: PrimeNG 12 / Primeflex 3
Looking around Internet, I found the following snippet, that works fine:
[style]="{'width':'100%', 'background-color':'greenyellow'}"
But I would like to keep all style rules concentrated in the CSS file, instead of using inline style, directly on the element. I tried the following codes, but none of them worked
<p-dropdown [class]="'dd-style'" [options]="cities" [(ngModel)]="selectedCity"></p-dropdown>
<p-dropdown class="dd-style" [options]="cities" [(ngModel)]="selectedCity"></p-dropdown>
<p-dropdown [styleClass]="'dd-style'" [options]="cities" [(ngModel)]="selectedCity"></p-dropdown>
<p-dropdown styleClass="dd-style" [options]="cities" [(ngModel)]="selectedCity"></p-dropdown>
My CSS class:
.dd-style {
width: 100% !important;
background-color: greenyellow;
}
Wraping up... Is that possible to keep the style rules for dropdown element concentrated in the CSS file?
Applying styles to p-dropdown element
-
- Information
-
Who is online
Users browsing this forum: No registered users and 8 guests