Subject: CSS :nth-of-type(odd) and :nth-child(odd) Selectors Not Working in Mendix

0
I’m encountering an issue with applying CSS styles to specific elements within Mendix. I’ve tried styling elements with the class .widget-accordion-group-header-button-icon-right that are in odd positions using both the :nth-of-type(odd) and :nth-child(odd) selectors, but the styles are not being applied as expected.   Here’s the CSS I’ve attempted: .widget-accordion-group-header-button-icon-right:nth-of-type(odd) {  background-color: blue !important;}.widget-accordion-group-header-button-icon-right:nth-child(odd) {  background-color: blue !important;} Despite this, the background color is not changing as anticipated. I have checked the following: The CSS file is properly linked and loaded in the project. The class names and HTML structure are correct. No other CSS rules are overriding my styles. Could anyone provide guidance on why this might not be working in Mendix or suggest any troubleshooting steps? Thank you in advance for your assistance!
asked
1 answers
0

There is only 1 button-icon-right per widget-accordion-group right? You might have to do the odd / even distinction at a higher level and once you've got the selected one go in through nesting and set the specific button to whichever is desired.

 

so as follows:

 

.widget-accordion-group:nth-of-type(odd) {
    .widget-accordion-group-header-button-icon-right {
      background-color: blue !important;
    }
  }

 

 

 

answered