Topic: Style select options
                  
                  dhermann
                  premium
                  asked 3 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
                      
                      Mateusz Lazaru
                      staff
                        answered 3 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
                      premium
                        answered 3 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.
Mateusz Lazaru staff commented 3 years ago
Thank you for sharing your opinion with us. I've added this feature to our ideas section in ToDo list.
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- ForumUser: Premium
- 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: Yes
- Provided link: Yes