I am using primeng in my app and I want to customize just one option in the p-dropdown but not sure how to go about it.
<p-dropdown id="dropdown" [options]="options" optionLabel="name" optionValue="name"></p-dropdown>
I have this as my css:
p-dropdown ::ng-deep .p-dropdown-item {
/* my custom css for one option only */
}
and I have tried using :first, :first-child, :first-of-type, :nth-child, :nth-of-type to see if I can target just one option but it still applies the css to all the options in the dropdown. How can I go about this?
PS: This question has nothing to do with the select element and everything to do with the primeng p-dropdown element. Please read the question in its entirety.
Please note that there are
p-dropdownitemelement andp-dropdown-itemCSS class:so,
:first-itemshould be applied to the element and not its child element with that class:hope this helped :)