我有一個html下拉菜單。在下拉列表中,有些選項的長字符串沒有任何空格。我想將這些選項包裝到下一行。我使用CSS word-wrap
屬性。它在Chrome中適用於我,但不適用於Firefox。CSS屬性自動換行不適用於Firefox上的select元素
我也用word-break
財產試過的建議in the suggested duplicate
我也做了a demo on jsfiddle。它在Chrome上看起來很好,但如果您在Firefox上打開該演示文稿,則文本無法換行。我怎樣才能解決這個問題?
.setWidth {
width: 300px
}
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-4">
<select class="formNamesList setWidth" id="CustomCategories" name="CustomCategories" size="15">
<option value="10085240">_1Test_Today</option>
<option value="10085242">_1Test_Today_A</option>
<option value="10085091" style="word-wrap:break-word">testcust_copyFinal_copytetshhshshshhshshhshshshhshshhshshhshshshshhshshshshhshshshshhshshhshs</option>
</select>
</div>
https://css-tricks.com/almanac/properties/w/word-break/的 – Hbirjand
可能重複[自動換行不能在Firefox的工作,想盡一切(http://stackoverflow.com/問題/ 19869653/word-wrap-not-working-in-firefox-tried-everything) – Hbirjand
我已經看到了這些鏈接。但沒有運氣與沒有空格的字符串@hbirjand –