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