CSS Web page making tips: CSS Pure English digital word wrapping

Source: Internet
Author: User

Article Introduction: and when the number or the English language with Chinese characters, will be changed from the Chinese characters, and the pure Chinese characters can be automatically wrapped. How to solve this problem? First come to know the two protagonists word-wrap and Word-break.

When a block element with a defined width is filled with pure English or pure digits, it will support large containers in IE and FF and will not wrap automatically.

And when the number or the English language with Chinese characters, will be changed from the Chinese characters, and the pure Chinese characters can be automatically wrapped. How to solve this problem? First, get to know the two protagonists word-wrap and Word-break.

word-wrap used to control line wrapping
Two kinds of values:
(1) Normal
(2) Break-word (this value is used to force a newline, the content will be wrapped within the boundary line, there is no problem in Chinese, English sentence is no problem.) 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 (is disconnected from the word.) The next letter automatically comes to the next line when the word is to the boundary. Mainly solved the long string of English problems. )
(3) Keep-all (refers to Chinese, Japanese, and Korean continuous 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;

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.