CSS mandatory English, Chinese word wrapping and non-newline force English line break

Source: Internet
Author: User

1. Word-break:break-all; only works on English, with the letter as the line of change according to 2. Word-wrap:break-word; Only works in English, with the word as the line of change according to 3. White-space:pre-wrap; Only works on Chinese, forcing line 4. White-space:nowrap; Force no line break, all functions 5. White-space:nowrap; Overflow:hidden; Text-overflow:ellipsis, non-wrapping, partially hidden and appearing as ellipses (partial browser support) code:. p1{word-break:break-all; width:150px;} /* only works on English, with letters as the basis for line */.p2{Word-wrap:break-word; width:150px;} /*--only works in English, with words as the basis for line */.p3{white-space:pre-wrap; width:150px;} /* Only works on Chinese, forced line */.p4{white-space:nowrap; width:10px;} /* Force No Line break, all work */.p5{white-space:nowrap; overflow:hidden; text-overflow:ellipsis; width:100px;} * Do not wrap, out of part hidden and appear in the form of ellipses * * Note, be sure to specify the width of the container, otherwise it is useless. Note Word-break is the ie5+ proprietary attribute syntax: Word-break:normal | Break-all | Keep-all parameter: Normal: Allows word wrapping in words according to the rules of Asian and non-Asian languages Break-all: This behavior is the same as the normal for Asian languages. Also allows non-Asian-language text lines to be broken within any word. This value is appropriate for Asian text keep-all that contains some non-Asian text: Same as normal for all non-Asian languages. For Chinese, Korean, Japanese, word break is not allowed. For non-Asian text descriptions that contain small amounts of Asian text: Sets or retrieves the word wrapping behavior of text within an object. Especially when multiple languages are present. For Chinese, break-all should be used. Note that compatibility with Firefox is mandatory for English word-wrap: <div style= "Word-wrap:break-word; White-space:normal; Word-break:break-all; width:150px;"> English content </div> 

  

CSS mandatory English, Chinese word wrapping and non-newline force English line break

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.