Let text wrap in div display

Source: Internet
Author: User

1.

<style>Div{White-space:Normal;Word-break:Break-all;Word-wrap:Break-word;          }    </style> <Divstyle= "width:100px; border:1px solid Red">I am a DOIBIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII</Div>

Pre-CSS effect:-------> Add Effect:

2. These three sentences focus on: Word-break and Word-wrap

The A:word-break property specifies how the wrap is handled.

tip : By using the Word-break property, you can let your browser implement line breaks anywhere.

value Description
Normal Use the browser's default line-wrapping rule.
Break-all Allows line wrapping within a word.
Keep-all

You can only wrap at half-width spaces or hyphens.

The B:word-wrap property allows long words or URL addresses to wrap to the next line.

value Description
Normal Line breaks only on allowed hyphenation points (the browser keeps the default processing).
Break-word Wraps a line inside a long word or URL address.

Or look at the example:

<style>Div{Word-wrap:Break-word;          }    </style><Divstyle= "width:100px; border:1px solid Red">I am a DOIBIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII</Div>

Results:

Wraps the DOBIIIIIIIIIIIIIIIIIII as a whole in a line-wrapping display.

<style>Div{Word-break:Break-all;                  }    </style><Divstyle= "width:100px; border:1px solid Red">I am a DOIBIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII</Div>

Results:

DOBIIIIIIIIIIIIIIIIIII truncation for line break display.

I think the difference between the two should be very clear!

Let text wrap in div display

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.