如果文字太长,我希望<select>
<option>
换行。
select {
overflow-wrap: break-word;
word-wrap: break-word;
white-space: -moz-pre-wrap;
white-space: pre-wrap;
}
&#13;
<select style="width:130px;">
<option value="47" selected="selected">Traditur Preascep irruit. Sed now possum Non adamare te. Maneam</option>
</select>
&#13;
但是当我在Firefox上测试时,文本是隐藏的,而不是包装的。如何解决这个问题?
答案 0 :(得分:0)
尝试一下......
<!--html-->
<select>
<option value="47" selected="selected">Traditur Preascep irruit. Sed now possum Non adamare te. Maneam</option>
</select>
/*css*/
select {
overflow-wrap: break-word;
word-wrap: break-word;
white-space: -moz-pre-wrap;
white-space: pre-wrap;
width:auto;
}