I'm struggling with a rendering issue using Django Grappelli and Django Multiselectfield together in the admin-site. The checkbox labels are misaligned:
Grappelli defines two CSS classes:
.aligned label {
display: block; float: left;
padding: 0 10px 6px 0;
width: 120px;
}
.aligned .vCheckboxLabel {
display: inline; float: none; clear: both;
margin: 0 0 0 10px; padding: 0;
}
If I change the checkbox class to ".vCheckboxLabel" in the browser console, the labels are aligned correctly and there's no issue. However, I can't for the life of me find how to set the class in the admin template.
Using {% if field.is_checkbox %}
in the Django admin template doesn't work because it's a multiselectfield, which is instead rendered as a list of checkboxes in {{ field.field }}
.
How can I specify or override the class for MultiSelectField checkboxes in the template or elsewhere?