CSS forces line breaks between English and Chinese characters.

Source: Internet
Author: User

. P1 {word-break: Break-all; width: 150px;}/* only applies to English letters. Use letters as the line feed basis */

. P2 {word-wrap: Break-word; width: 150px;}/* -- only applies to English. Use words as the line feed basis */

. P3 {white-space: Pre-wrap; width: 150px;}/* only applies to Chinese characters and forces line breaks */

. P4 {white-space: nowrap; width: 10px;}/* force do not wrap, all functions */

. P5 {white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100px;} // * the excess part is hidden and appears as a ellipsis */

1. Word-break: Break-all; takes effect only in English and uses letters as the line feed basis.

2. Word-wrap: Break-word; only used for English. Use words as the basis for line feed.

3. {white-space: Pre-wrap; takes effect only for Chinese characters, force line feed

4. {white-space: nowrap; force line breaks.

5. {white-space: nowrap; overflow: hidden; text-overflow: ellipsis; no line breaks. the excess part is hidden and appears as a ellipsis.

Note that you must specify the container width, otherwise it will be useless.
Note that word-break is ie5 + proprietary.

Syntax:
Word-break: normal | break-All | keep-all

Parameters:
Normal: line breaks are allowed according to the text rules of the Asian and non-Asian languages.
Break-ALL: this behavior is the same as that of the Asian language normal. It also allows non-Asian text lines to be broken in any word. This value is applicable to Asian texts that contain non-Asian texts.
Keep-ALL: same as normal in all non-Asian languages. Chinese, Korean, and Japanese cannot be disconnected. Suitable for non-Asian texts that contain a small number of Asian texts

Note:
Set or retrieve the line feed behavior of text in an object. Especially when there are multiple languages.
Use break-all for Chinese characters.

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.