白色空间不适用于Firefox

时间:2016-07-04 12:29:57

标签: html css css3

如果文字太长,我希望<select> <option>换行。

&#13;
&#13;
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;
&#13;
&#13;

但是当我在Firefox上测试时,文本是隐藏的,而不是包装的。如何解决这个问题?

1 个答案:

答案 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;

}