Word-break and word-wrap

Source: Internet
Author: User

Word-break and word-wrap are the same in many cases. They did not see the difference one morning.

Example:

. Mbox H2 span. top_notice {Font: normal 12px ""; position: absolute; Right: 10px; bottom: 1px; line-Height: 40px; padding-left: 20px; Background: URL (/static/CSS/I/top_notice.gif) No-repeat 0 12px; overflow: hidden; width: 480px; Height: 40px; text-overflow: ellipsis; white-space: nowrap ;}

 

Word-break
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.

1. Break-all
As long as the width is exceeded, No matter what content is wrapped (text, English, number ).
2. Normal
Distinguish between text and English (numbers). If the excess part encounters text, it will wrap the line. If it is English and a number, the entire line (English and numbers) will be placed in the next line.
3. Keep-all
No matter what content (text, English, and numbers), there is no line break, unless there is a word disconnected.

Word-wrap
Syntax:
Word-wrap: normal | break-word
 
Parameters:
Normal: allows the content to expand the specified container boundary.
Break-word: the content will wrap in the boundary. If necessary, the line feed (Word-break) also occurs.
 
Note:
Sets or retrieves whether to disconnect the dashboard when the forward time exceeds the boundary of the specified container.

1. Break-word
When break-word is used, a line break is forced. There is no problem with Chinese and no problem with English statements. However, long strings do not work in English.
2. Normal
Distinguish between text and English (numbers). If the excess part encounters text, it will wrap the line. If it is English and a number, the entire line (English and numbers) will be placed in the next line.

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.