We often see in the page, such as Web site can not be broken automatically (as shown below)
If it is a Chinese character, you can wrap the line automatically. If it is a continuous English or number will be regarded as a word, even if the maximum width will not automatically break, but directly to the next line.
So here you can use Word-break:break-all to achieve a long English automatic break (the effect of the following figure).
Such as
The code is as follows |
Copy Code |
: <p style= "Word-break:break-all;" ></p> |
Finally, summarize
1. (ie browser) consecutive English characters and Arabic numerals, using Word-wrap:break-word or Word-break:break-all;
The code is as follows |
Copy Code |
#wrap {word-break:break-all; width:200px;} Or #wrap {word-wrap:break-word; width:200px;} <div id= "Wrap" >abcdefghijklmnabcdefghijklmnabcdefghijklmn111111111</div> |
Effect: You can implement line wrapping
2. (Firefox browser) consecutive English characters and Arabic numerals break, all versions of Firefox did not solve this problem, we have to let go beyond the bounds of the characters hidden or, add a scroll bar to the container
The code is as follows |
Copy Code |
#wrap {word-break:break-all; width:200px; overflow:auto;}
<div id= "Wrap" >abcdefghijklmnabcdefghijklmnabcdefghijklmn111111111</div> |
Effect: Container normal, content hidden