December 29, 2020 at 2:50 am
#10035524
Keymaster
Hello,
Here’s the code you need:
HTML:
<select>
<optgroup label="Programming Languages">
<option value="php">PHP</option>
<option value="java">JAVA</option>
</optgroup>
<optgroup label="Data Base">
<option value="sql">SQL</option>
<option value="db2">DB2</option>
</optgroup>
</select>
CSS (css/custom.css):
optgroup:nth-child(1) {
background: red;
}
optgroup:nth-child(2) {
background: yellow;
}
Note the nth-child(xxx) selector. This way you can have different colors for each optgroup.
If you want the same color for all optgroups, here’s the CSS code you need:
optgroup {
background: red;
}
We hope this helps!
Please try that and let us know if you need further assistance.
Kind Regards,
Rodrigo.
If you are satisfied with Porto Admin and our support, please leave your comment and rating on ThemeForest downloads page. That helps us a lot: https://themeforest.net/downloads