The difference between Word-break:break-all and Word-wrap:break-word

Source: Internet
Author: User

Understanding Word-break Properties

/* keyword value */word-break:normal; Word-break:break-all; word-break:keep-all;/* Global value */word-break:inherit;word-break:initial;word-break:unset;
Normal
Use the default line-wrapping rule.
Break-all
Allows word breaks between any non-CJK (Chinese/japanese/korean) text.
Keep-all
Word wrapping in CJK (Chinese/japanese/korean) text is not allowed and can only be wrapped in half-width spaces or hyphens. The behavior of non-CJK text is actually and normal consistent.

Where break-all this value is supported by all browsers. But keep-all this is not the case, although there is a certain development and progress –CHROME44 formally supported, but the iOS SAFARI8/9 are not supported (the table below the yellow-green expression is not supported keep-all ). In other words, the mobile side is not yet suitable for use word-break:keep-all .

Understanding Word-wrap Properties
/* Keyword value */word-wrap:normal;word-wrap:break-word;/* global value */word-wrap:inherit;word-wrap:initial;word-wrap:unset;

  

The meanings of several keyword values are as follows:

Normal
This is the normal line-break rule that everyone usually sees the most.
Break-word
There is really no other line in a line of words to break the line.
word-break:break-all as its name, all the lines are wrapped. No mercy, no gaps are spared. And word-wrap:break-word then with compassion, if this line of text has a line that can be wrapped, such as a space, or CJK (Chinese/japanese/korean) (Chinese/Japanese/Korean) and the like, then do not hit the idea of English words or characters, let these line-break point line, as for the right alignment, Not good looking, then don't care.
is the spacing between the words, whether the characters are wrapped in a line display.
word-spacing white-space

The difference between Word-break:break-all and Word-wrap:break-word

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.