CSS Implementation Force no Line break/wrap/Force line wrapping

Source: Internet
Author: User

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

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.