In the work I encountered a problem, in fact, the function is not complex, that is, there is a textatea tag, the input content, below a display effect, there is a condition is the above input of what format (such as line change and so on), the
What are these two things, I believe there are still a lot of people confused, will only be rote writing a word-wrap:break-word;word-break:break-all, such things to force the segmentation, or because these two things are too awkward, The same length,
This article mainly introduces about CSS (Word-wrap/break) so that the pure English digital automatic line-wrapping, has a certain reference value, now share to everyone, the need for friends can refer to
In IE and FF will support large containers,
Word-wrap
Word-wap:break-all
Apply the scene, the English word too long, and just at the end of the sentence, then you can break the word, not enough of the second line to display, according to the above literal meaning is also so, all
Word-wrap: Allows splitting of long, indivisible words and wrapping to the next line. (same effect in English and Chinese)Word-wrap has two values:1. Word-wrap:normal: line breaks only allowed hyphenation points (the browser keeps the default
Word-wrap: Allows splitting of long, indivisible words and wrapping to the next line. (same effect in English and Chinese)Word-wrap has two values:1. Word-wrap:normal: line breaks only allowed hyphenation points (the browser keeps the default
ProblemWhen a block element that defines the width is filled with all plain English or pure numbers, it will hold large containers in IE and FF, do not wrap automatically, and when numbers or English characters are in Chinese, they will be wrapped
Text Box continuous inputNumber "111111111111111111" orThe English word "adkjsakfjsalfkjsalkdjaslkfjsalkf"What will happen? --- Text overflow. The general solution is to use overflow: hidden to hide text. Is there a better solution to text? For
CSS in the mention of word breaking, the first to be reflected in the mind is the Word-break and word-wrap these two attributes. But what's the difference between these two properties, and how compatible, I've always had a vague concept. Take the
1. word-break: break-all: for example, if the div width is PX, its content will be automatically wrapped in px. If the end of the line has a long English word (congratulation, etc ), it truncates the word and converts it to the backend part of the
In css3, word-wrap is allowed in the word and how to deal with the word-break, css3word-wrap
First, let's talk about the default behavior of the browser. When a long word is too long to exceed its region, it is first moved to the next line.
1.
Word-wrap:First of all, Word-wrap this CSS property in CSS3 has been renamed to Overflow-wrap, so semantic is also to avoid confusion with word-break;
Reference:
The property was overflow used to specify whether or not the
The following is a reference fragment:Word-wrap:break-word; Overflow:hidden;
Instead of
The following is a reference fragment:Word-wrap:break-word; Word-break:break-all;
It's not
The following is
Chinese Chinese Chinese Chinese Chinese Organization Logistics Management Center Technical Equipment Center Staff Training Center Resource Information Center Enforce Chinese word wrap CSS property settings
Today encountered TD text content does not wrap, found that: White-space:nowrap, that is, forced text does not wrap, by the way, the text wraps the property Word-wrap, summarized as follows:
The default for White-space is normal, which wraps
Article excerpt from: http://blog.csdn.net/cicada_slough/article/details/433053811. Word-break:break-all; only works in English, with the letter as the basis for line change2. Word-wrap:break-word; Only works in English, with words as the basis for
I suddenly realized that I had been writing pages in my previous way of thinking, and I did not notice many details. Although it is truncated, the details still exist. For example, a word is also truncated when it is not required to be truncated, so
Today encountered a problem, the table inside the contents of all replaced this line, in the TD add attribute Word-break:break-all can.Compare several line-wrapping related properties and make a summary:White-space:normal natural display, that is,
The default value of white-space is normal and the line feed is automatically generated. Word-break: break-all and word-wrap: break-word indicate forced line breaks. If the former is too long, it is automatically truncated. Otherwise, the entire
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.