开发者

How to fix size for drop down menu with css

I need these two drop down menus to be a fixed size and not auto resized depending on their content text length. hown can I make it so that its a fixed size but then when clicked it would resize开发者_C百科 so that the longer words in the list also show without a horizontal scroll bar


To set sizes on cross-client interfaces I simply parse the list and add an option to the list with a line of all 0's [zeros]. By adding or deleting zeros from that line you can get a uniform size on your selects lists for all browsers, font size and type dependent of course. After the document loads have javascript remove the select list option with the zeros and you are left with a static width select list.

Example:


<select>
    <option value="SIZER">0000000000000000000000000000</option>
</select>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜