I’m not really sure what you’re trying to achieve. This is simply a select
list. Just remove your styling and it will automatically size to your contents.
EDIT
Make the container that contains the list scroll. Note: the usability of this is somewhat questionable so I would look for another solution prior to implementing something like this on a page.
<div id="selector_cat">
<select name="sets">
<option value="general">happy holiday</option>
<option value="garden">Garden</option>
<option value="Lunch">Lunch</option>
<option value="nice day">A nice day out with my friend on the beach</option>
</select>
</div>
#selector_cat{
width: 100px;
overflow: auto;
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…