<Div id = "wrap"> normal text wrap (Asian text and non-Asian text) elements have the default white-space: normal, when defined </div>
Css
The code is as follows: |
Copy code |
# Wrap {white-space: normal; width: 200px ;} |
1. (ie browser) for continuous English characters and Arabic numbers, use word-wrap: break-word; or word-break: break-all; to implement forced line disconnection
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"> abcdefghijklmnabcdefghijklmnabcdefghijklmn1111111 </div> |
Effect: line breaks can be implemented.
2. (firefox) continuous disconnection of English characters and Arabic numbers. All firefox versions do not solve this problem. We only need to hide the characters that exceed the boundary 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"> abcdefghijklmnabcdefghijklmnabcdefghijklmn1111111 </div> |
Effect: The container is normal and the content is hidden.