加上如下的CSS设置,就是设定好宽度width,然后设置合适的word-wrapword-break属性:

.breakAll{
  white-space:normal;
  word-break:keep-all;
  word-wrap: break-word;
}

 

 


word-warp 属性设置如何处理单词的折行,可以取的值有ul里面的li折行其实跟其他块状(block)元素的折行都是一样的。以下是相关的CSS属性:

word-wrap: normal | break-word

 

word-break 属性设置如何处理单词折断,仅支持IE,可以取的值有:

word-break: normal | break-all | hyphenate

 

white-space 属性设置如何处理元素内的空白。可以取的值有:

white-space: normal | nowarp | pre | pre-line | pre-warp | inherit

 

经测试对中文也有效。

相关文章:

  • 2022-12-23
  • 2021-11-12
  • 2022-01-07
  • 2021-11-11
  • 2021-10-21
  • 2022-01-07
  • 2021-10-12
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-01-07
  • 2022-12-23
  • 2021-07-11
  • 2022-01-07
  • 2022-01-07
  • 2021-11-02
相关资源
相似解决方案