hello,
i try to customize select2 option CSS in metronic 8, without success.
What's wrong ?
<select class="form-select form-select-solid mb-2" name="regroupements" data-control="select2" data-placeholder="Select something" data-allow-clear="true" multiple>
<option></option>
{% for niv1 in niveau1 %}
<option value="{{ niv1.id }}">{{ niv1.caption }}</option>
{% for niv2 in niveau2 %}
<option class="l2" value="{{ niv2.id }}">{{ niv2.caption }}</option>
{% endfor %}
{% endfor %}
</select>
.l2 {
padding-left:20px !important;
}
Hi,
Please note that according to HTML/CSS specifications the OPTION tag can not be styled.
Select2 uses DIV tags to create a customized dropdown menu based on the standard select element markup and you can style those custom DIV elements of the Select2 dropdown.
if you can explain your requirements we will give you show directions.
In the meantime you can check the Select2's available options in the Metronic Select2 documentation.
Regards.