tl; dr: Add this CSS rule to your styles.css:
.chosen-container .chosen-results { max-height:100px; }
At first, I did not understand this, but this selector actually applies to classes inside Chosen (the library generates its own html elements that are separate from the
<select> element). They do not apply to the container that you, the developer, set to Favorites, so they will work in any situation.
However, even when I realized that this selector would not work as selected.css has the same selector, and since the last rule declared wins , my rule had no effect. There are two solutions for this:
- Add
!important to your custom rule (possibly the wrong way)
OR
Make sure your styles.css is declared after selected.css. My links were in the following order:
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="chosen/chosen.css">
If you change the order so that your main.css (or what you called your stylesheet) is declared after , the problem will also be solved.
Miguel
source share