How to realize automatic line wrapping of long English letters or long numbers in div by CSS
This article mainly explains "how CSS can automatically wrap long English letters or long numbers in div". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "CSS how to automatically wrap long English letters or long numbers in div".
Of course, the automatic line wrapping of Chinese characters in DIV or any box does not need to be implemented in CSS style, and only consecutive letters or numbers will not automatically wrap, so it needs to be solved by CSS.
Screenshot of the problem that English letters or numbers overflow DIV without line wrapping in DIV
But it is usually rare to have endless rows of letters or numbers in a box, which can be solved using the following CSS DIV tutorials.
1. CSS solution
Word-wrap:break-word
Explanation: when using break-word, line feeds are forced.
Compatible with all versions of IE browser, compatible with Google browser.
2. Screenshot of example code and effect of CSS automatic line wrapping
1. Complete HTML+CSS code
DIVCSS5 CSS English automatic line wrapping online example. {border:1px solid # 00F; height:120px; width:200px;word-wrap:break-word} aabbfjdlkfldsjfldsjfldjfljdlafjldsjflkdjflkdsjfldfjdlj 13878437489274932743949327493
2. Screenshot of the effect of an example
Thank you for your reading, the above is the content of "CSS how to automatically wrap long English letters or long numbers in div". After the study of this article, I believe you have a deeper understanding of how CSS can achieve automatic line wrapping of long English letters or long numbers in div, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!