CSS in Word-break can solve this problem, write a test page to make a note
CSS code:
body{font-size:14px;} p{border:solid 1px red;width:200px;} <body> <p class= "Test" > Chinese Chinowen englis333henglishenglishenglish Chinese, Chinese, Chinese Chinoven Chinoven Chinoven 123ewewee 123EnglishEnglishEnglishEnglishEnglishEnglishEnglishEnglishEnglishEnglishEnglishEnglishEnglishEnglishEnglishEnglishEnglis Henglishenglishenglish </p></body>
At this time the effect of the operation, such as the opening of the title, the following p tag dot style
CSS code:
. test{Word-break:break-all;}
Can find all the text, whether it is Chinese or English or the number can be in the end of the p tag of the package automatically forced career change, there will be a problem, will be a combination of the string split to see the effect of the effect, and then see a
CSS code:
. test {word-break:hyphenate;}
This CSS will potentially break the wrap element's character segment at the hyphenation point to advance the line
Look again
CSS code:
. test{Word-break:keep-all;}
Wraps the spaces between all the character segments and the character segments, preserving the integrity of all the character segments. Bursting package elements
Word-break also has some properties:
CSS code:
. test{Word-break:normal;} /* Browser Default line-break */
If you do not need to maintain the integrity of the word, break-all can solve the problem of bursting containers, because in the actual application process will not be more than a container width of the word, so hyphenate can solve the word is complete and can not burst container, Second, in some scenarios, scroll bars or overflow:hidden can be used to maintain the integrity of the interface.