使用word-wrap属性使超出元素边框的部分换行
p.test {word-wrap:break-word;}
- ‘
normal
’ - Lines may break only at allowed break points. However, the restrictions introduced by ‘
word-break: keep-all
’ may be relaxed to match ‘word-break: normal
’ if there are no otherwise-acceptable break points in the line. - ‘
break-word
’ - An unbreakable "word" may be broken at an arbitrary point if there are no otherwise-acceptable break points in the line. Shaping characters are still shaped as if the word were not broken, and grapheme clusters must together stay as one unit. No hyphenation character is inserted at the break point.