我必须select
在我的 html 中指定宽度。
它在除 IE8 之外的所有浏览器中都能正常工作,它会剪切超过宽度的文本
CSS
select {
border: 1px solid #65A6BA;
font-size: 11px;
margin-left: 22px;
width: 166px;
}
HTML
<select>
<option value="1">Some text</option>
<option value="2">Text Larger Than the Width of select</option>
<option value="3">Some text</option>
<option value="4">Some text</option>
<option value="5">Some text</option>
</select>
我对 js、jquery 解决方案持开放态度,但更喜欢仅使用 css 的解决方案