Force No Line break
Div { white-space:nowrap;}
Wrap Line
Div { word-wrap: break-word; word-break: normal;}
Force English words to break
Div { word-break:break-all;}
Word-wrap:
The Word-wrap property of CSS is used to indicate whether a browser is allowed to segment within a word, which is to prevent overflow when a string is too long and cannot find its natural segmentation point.
Word-break:
CSS's Word-break attribute is used to indicate how words are segmented within a word.
Definition and usage
The 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.
Default value: |
Normal |
Inheritance: |
Yes |
Version: |
CSS3 |
JavaScript Syntax: |
object. style.wordbreak= "Keep-all" |
Grammar
Word-break:normal|break-all|keep-all;
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. |
Definition and usage
The Word-wrap property allows long words or URL addresses to wrap to the next line.
Default value: |
Normal |
Inheritance: |
Yes |
Version: |
CSS3 |
JavaScript Syntax: |
object. style.wordwrap= "Break-word" |
Grammar
Word-wrap:normal|break-word;
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. |
CSS Reference Manuals
CSS Implementation Force no Line break/wrap/Force line wrapping