CSS Tutorial: How to avoid hiding a half word css

Source: Internet
Author: User
Keywords Web page production CSS Tutorials
Tags automatic broken css tutorial data display how to list name

found that the user name is hidden away half Chinese characters very awkward!!
So how to avoid this situation!
General Chinese fonts We have set the automatic line, that is, each Chinese character has been broken into a separate element; When a line of Chinese characters is more than the width of the container is on the line to show, then how to fold the Chinese character? We often set a list of left floats to display a set of data horizontally, when we do not set the width of Li elements, and the parent container can not just load the whole number of LI elements, ie will occur a phenomenon (such a phenomenon that we have encountered 2 times, are not to the container specified width caused), This is the last one can not be fully inclusive of the LI element of the problem will be along the right edge of the container in a word of the width of the vertical row, without setting the correct height of the case, this phenomenon is not affected by Overflow:hidden! When we give Li the width of the case, the last side of this can not be fully inclusive of Li to the downward display.
This situation just explains the browser wrapping mechanism, the mechanism is that without setting the width of the parent element, the browser will fold according to the width of the last irreducible element, the last element in the Asian language is a separate font.
Write here the answer to the itch of half word is solved, that is not to set White-space:nowarp to Chinese character; and White-space:pre; Not to use the text to break the attribute Word-break:break-all, and then use the Word-break:keep-all property.
Ps:word-break:keep-all to keep the text consistent with non-Asian languages! (English is not going to change the line!) )

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.