CSS mandatory in English, Chinese and non-line wrapping

Source: Internet
Author: User

When you design HTML, you will encounter CSS forcing English, Chinese and non-line wrapping problems, you can learn about the relevant knowledge.

Structure:

1.Transshipment Booking System is launched only works in English, with letters as the basis for line breaks

2.Transshipment Booking System is launched only works in English, with words as the basis for line breaks

3.Transshipment Booking System is launched only works on Chinese, force line break

4.Transshipment Booking System is launched force no line break, all works

5. Do not wrap, out of partially hidden and appear as ellipses

5. Do not wrap, out of partially hidden and appear as ellipses transshipment Booking System is launched

Code:

. p1{word-break:break-all; width:150px;} /* only works in English, with the letter as the line of exchange * *

. p2{Word-wrap:break-word; width:150px;} /*--only works in English, with words as the basis for line change * *

. p3{white-space:pre-wrap; width:150px;} /* Only works on Chinese, forced line break */

. p4{white-space:nowrap; width:10px;} /* Force No Line break, all works */

P5{white-space:nowrap; overflow:hidden; text-overflow:ellipsis; width:100px;} * Do not wrap, out of partially hidden and appear as ellipses */

1. Word-break:break-all; only works in English, with the letter as the basis for line change

2. Word-wrap:break-word; Only works in English, with words as the basis for line change

3.{white-space:pre-wrap; only works on Chinese, force line break

4.{white-space:nowrap; Force no line break, all work

5.{white-space:nowrap; overflow:hidden; text-overflow:ellipsis; not wrapped, partially hidden and appearing as ellipses

Note that you must specify the width of the container, otherwise it is useless.

Note Word-break is a ie5+ proprietary property

Grammar:

Word-break:normal | Break-all | Keep-all

Parameters:

Normal: Allow line wrapping in words according to Asian and non-Asian language text rules

Break-all: The behavior is the same as in Asian languages. Also allows non-Asian-language text lines to be broken within any word. This value is appropriate for Asian text that contains some non-Asian text

Keep-all: Same as normal for all non-Asian languages. For Chinese, Korean, Japanese, word break is not allowed. Suitable for non-Asian texts containing small amounts of Asian text

Description

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.

CSS mandatory in English, Chinese and non-line wrapping

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.