CSS (word-wrap/break) to make pure English numerals wrap

Source: Internet
Author: User
This article mainly introduces about CSS (Word-wrap/break) so that the pure English digital automatic line-wrapping, has a certain reference value, now share to everyone, the need for friends can refer to

In IE and FF will support large containers, will not automatically wrap and when the number or English with Chinese characters, will be changed from the Chinese characters, and pure Chinese characters can be automatically wrapped, in response to this problem, this article gives a detailed solution, interested friends can not miss Ah, I hope this article to you some help

When a block element that defines the width is filled with all plain English or pure numbers, it will hold large containers in IE and FF, do not wrap automatically, and when numbers or English characters are in Chinese, they will be wrapped in Chinese characters, while pure Chinese characters can be automatically wrapped. How to solve this problem? Let's meet two characters Word-wrap and Word-break.
Word-wrap to control line breaks
Two types of values:
(1) Normal
(2) Break-word (this value is used to force line wrapping, the content will be wrapped within the boundary, there is no problem in Chinese, the English sentence is OK.) But for long strings of English, it doesn't work. )
Word-break used to control word breaks .
Three kinds of values:
(1) Normal
(2) Break-all (the word is broken.) The next letter is automatically to the next line when the word is to the border. It mainly solves the problem of long strings of English. )
(3) Keep-all (refers to Chinese, Japanese, and Korean constant words, a line of words, can be used to arrange ancient poetry yo ~)
"Workaround"
can be added in CSS

Word-wrap:break-word; Word-break:break-all;

(1) Break-all (the word is broken.) The next letter is automatically to the next line when the word is to the border. It mainly solves the problem of long strings of English. )
(2) Keep-all (refers to Chinese, Japanese, and Korean constant words, a line of words, can be used to arrange ancient poetry yo ~)
(3) Break-word (this value is used to force line wrapping, the content will be wrapped within the boundary, there is no problem in Chinese, the English sentence is OK.) But for long strings of English, it doesn't work. )

The above is the whole content of this article, I hope that everyone's learning has helped, more relevant content please pay attention to topic.alibabacloud.com!

Related recommendations:

The difference between forcing a newline word-break, Word-wrap, and White-space in CSS

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.