Style select options


Topic: Style select options

dhermann pro premium asked 2 years ago

Expected behavior I would like to style individual options inside of an mdb select. It looks like there are only a few attributes that are passed into the div.select-option elements and even the ids appear to be random so I cannot target with external CSS. Is there a way to do this? If not, can this feature be added?

Keep in mind that I want to style individual options, not all options, so targeting .select-option in my CSS is not sufficient.

Actual behavior No ids, classes, or styles can be passed from the option elements that will appear in their respective div.select-option elements.

Resources (screenshots, code snippets etc.) https://mdbootstrap.com/snippets/standard/dhermann/4066455


mlazaru staff answered 2 years ago

Hi,

currently the only way to style options is via CSS selectors. Use nth-child to style them individualy.

https://mdbootstrap.com/snippets/standard/mlazaru/4072993


dhermann pro premium answered 2 years ago

Thank you. I think adding a way to style individual options through attributes or just class options would be great. If possible, please add it to the upgrade list.


mlazaru staff commented 2 years ago

Thank you for sharing your opinion with us. I've added this feature to our ideas section in ToDo list.


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue
  • User: Pro
  • Premium support: Yes
  • Technology: MDB Standard
  • MDB Version: MDB5 4.1.0
  • Device: Desktop
  • Browser: Safari
  • OS: macOS Monterrey 12.0.1
  • Provided sample code: No
  • Provided link: Yes
Tags