I am currently utilizing jQuery
chosen plugin for my multi-select
box. However, I am facing some challenges with customizing the styles defined in the chosen.css
file as they are proving to be quite stubborn to override. Removing the entire chosen.css
file is not an ideal solution either.
For reference, here is the link to my fiddle: https://jsfiddle.net/k1Lr0342/
Snippet of the HTML:
<select class="chosen" multiple="true" style="height: 34px; width: 280px">
<option>Choose...</option>
<option>jQuery</option>
<option selected="selected">MooTools</option>
<option>Prototype</option>
<option selected="selected">Dojo Toolkit</option>
</select>
CSS snippet:
.chosen-choices {
border-radius: 3px;
box-shadow: inset 0px 1px 2px rgba(0,0,0,0.3);
border: none;
height: 34px !important;
cursor: text;
margin-top: 12px;
padding-left: 15px;
border-bottom: 1px solid #ddd;
width: 285px;
text-indent: 0;
margin-left: 30px;
}
In attempting to customize the styles for .chosen-choices
ul
, certain properties like margin, height, padding, border
, etc. are being overridden by the existing chosen.css
file. One workaround I've tried is using the !important declaration for each specific property, however, this has not proven effective with adjusting the height. Any suggestions or insights on how to tackle this issue?