HTML processing text wrap

Posted May 28, 20201 min read

Mainly for the accumulation of knowledge points that are often forgotten, the content of this article is relatively comprehensive, so I can learn from it here, [the original article address here]

 1.word-break:break-all. Only works in English, with letters as the basis for line breaks
 2.word-wrap:break-word. Only works in English, with words as the basis for line breaks
 3.white-space:pre-wrap. Only works for Chinese, force line breaks
 4.white-space:nowrap. Force no line breaks, all work
 5. white-space:nowrap.
    overflow:hidden
    text-overflow:ellipsis.
 No line breaks, hidden beyond and appear as ellipses

Note that you must specify the width of the container, otherwise it is useless.
Note that word-break is a proprietary attribute of IE5 +