我必須在我的html中指定一個寬度爲select
。IE 8固定寬度選擇問題
它正常工作,在所有瀏覽器除了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解決方案
要修復的寬度之後,你想,如果文本更多的則是你的選擇菜單應加大儀式? – supersaiyan
我想你永遠不會得到理想的結果。 IE8(及以下版本)已編程顯示如此的選擇列表。谷歌搜索和這彈出:http://css-tricks.com/select-cuts-off-options-in-ie-fix/哪種工作,它使選擇框更廣泛時懸停在IE中。然而,問題可能會出現,取決於你如何定位你的'select'元素。如果它只是內聯,那麼突然改變寬度可能會改變其他方面。 – Chris
不幸的是,解決方案不適合我,因爲選擇是在菜單中,這會導致菜單扭曲 –