Css solves the problem of automatic line breaks between English characters and digits.

Source: Internet
Author: User
Tags arabic numbers

 

Word-wrap controls the line feed. Optional values: word-wrap: break-word | normal | break-all | keep-all

Break-word: it is mainly used to control whether to forcibly wrap words. It has no problem with Chinese and English, but is invalid for long strings.

Normal: the English word is not separated. It is the default value.

Break-all mainly solves the problem of long strings in English. It is mainly used to disconnect words. When a word reaches the boundary, the next letter automatically goes to the next line.

Keep-all refers to continuous words between Chinese, Japanese, and words. That is to say, in this case, word-wrap is not used, and the Chinese text will not wrap. (The English statement is normal .)

IE: Use word-wrap: break-word; all are normal.

FF: If none of the two are used, there will be no problem with Chinese. There are no problems with English statements. However, long strings may cause problems in English.

To solve the problem of long strings in English, word-wrap: break-word; word-break: break-all; is generally used ;. However, this method causes the words in Common English statements to be disconnected (also in ie ).

The best way is word-wrap: break-word; overflow: hidden;

Instead of word-wrap: break-word; word-break: break-all;

It is not word-wrap: break-word; overflow: auto;

 

(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.

# Wrap {word-break: break-all; width: 200px; overflow: auto ;}

<Div id = "wrap"> abcdefghijklmnabcdefghijklmnabcdefghijklmn1111111 </div>

Effect: the container is normal and the content is hidden. Eat first !!

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.