div block-level elements within text wrapping Word-wrap, word-break,white-space.

Source: Internet
Author: User

Word-wrap:normal; || Word-break:normal;

When Word-wrap or Word-break is normal, which is the default setting for the browser.

The line break rule is this:

    Scenario One:  when a word cannot be fully accommodated at the end of a line, the word is automatically swapped to the next row, as shown below.

          

    Scenario Two: when a long word can not be fully accommodated at the end of the line, and the word can not be accommodated after wrapping, the words will overflow the container, such as below.

          

Word-wrap:break-word;

When Word-wrap is set to Break-word,

The line break rules are as follows:

Scenario One: same as normal.  

        

Scenario Two: at this point, the word does not overflow the container, but the word is broken and changed to the next line.  

            

Word-break:break-all;

When Word-break is set to Break-all,

The line break rules are as follows:

Scenario One: at this point, a change has taken place. The word does not wrap, but breaks the word and changes to the next line.  

        

    Scenario Two: at this time, compared with the previous, there has been a change. The word is still not wrapped, the word will continue to break, change to the next line.

        

Summarize:

The difference between normal and break is whether the word will be broken . Normal does not break the word, it only wraps the word whole or overflows the container. Break breaks the word line.

The difference between Word-wrap and Word-break is whether the word will wrap in its entirety. The former breaks the word as a whole, and the latter breaks the word directly.

div block-level elements within text wrapping Word-wrap, word-break,white-space.

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.