you change the 111111111111 to a Chinese test, because the system refers to a large pile of 111111111 as a word. A word is not a newline.
1. Force not to wrap and end with ellipsis.
<div style= "width:100px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" >
Hey, friend, friend, friend, why can't I see the effect?
</div>
2, CSS automatic line wrapping
div{Word-wrap:break-word; word-break:normal;}
3, CSS mandatory English word break
Div{word-break:break-all;}
If the div nesting, to make the inner div automatically wrapped according to the content, you can only set the outer div width, and white-spance:nowrap can be.
word-break:break-all and Word-wrap:break-word are the things that wrap their containers like Div.
The difference between them is:
1,word-break:break-all For example div width 200px, its content will go to 200px automatically wrap, if the line end has an English word very long (congratulation, etc.), it will truncate the word, into the line end of Conra ( Congratulation the front end part of the next behavior tulation (conguatulation) the back end part.
The 2,word-wrap:break-word example is the same as the above, but the difference is that it congratulation the whole word as a whole, and if the end of the line is not wide enough to display the whole word, it automatically puts the whole word on the next line without truncating the word.
3,word-break;break-all Support version: IE5 above this behavior is the same as the normal for Asian languages. Also allows any word in a non-Asian text line to be disconnected. This value is appropriate for Asian text that contains some non-Asian text. Word-wrap:break-word Support version: IE5.5 The above content will be wrapped within the boundary line. If necessary, the word wrap (word-break) will also occur. Forms are automatically wrapped to avoid distraction. Word-break:normal | Break-all | Keep-all parameter: Normal: Allows wrapping of lines within words according to the Asian and non-Asian text rules Break-all: This behavior is the same as normal for Asian languages. Also allows any word in a non-Asian text line to be disconnected. This value is appropriate for Asian text keep-all that contains some non-Asian text: the same as for all non-Asian languages. For Chinese, Korean, Japanese, word is not allowed to break. Non-Asian text syntax for containing small amounts of Asian text: Word-wrap:normal | Break-word parameter: Normal: Allows content to top open the specified container boundary Break-word: Content wraps within the boundary. If necessary, the word wrap (Word-break) also occurs when you set or retrieve whether a career change is broken when the current row exceeds the bounds of the specified container.
The corresponding script attribute is wordwrap. Please refer to other bibliographies I have written. Syntax: Table-layout:auto | Fixed parameter: Auto: Default automatic algorithm. The layout will be based on the contents of each cell. The table is not displayed until each cell is read and calculated. The speed is very slow fixed: fixed layout algorithm. In this algorithm, the horizontal layout is based solely on the width of the table, the width of the table border, the spacing of the cells, the width of the columns, and the table Content-Independent Description: Sets or retrieves the layout algorithm for the table. The corresponding script attribute is tablelayout.
Recommendation: Word-break 3C detection will show problems, resulting in Baidu snapshots will also be problematic-this property opera FIREFOX Browser also does not support word-break properties can be used white-space:normal; This way in Firefox and IE can be the correct line, and note that the words between the space can not be used to replace, or not correct line.
1. Force not to wrap and end with ellipsis.
<div style= "width:100px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" >
Hey, friend, friend, friend, why can't I see the effect?
</div>
2, CSS automatic line wrapping
div{Word-wrap:break-word; word-break:normal;}
3, CSS mandatory English word break
Div{word-break:break-all;}
If the div nesting, to make the inner div automatically wrapped according to the content, you can only set the outer div width, and white-spance:nowrap can be.
word-break:break-all and Word-wrap:break-word are the things that wrap their containers like Div.
The difference between them is:
1,word-break:break-all For example div width 200px, its content will go to 200px automatically wrap, if the line end has an English word very long (congratulation, etc.), it will truncate the word, into the line end of Conra ( Congratulation the front end part of the next behavior tulation (conguatulation) the back end part.
The 2,word-wrap:break-word example is the same as the above, but the difference is that it congratulation the whole word as a whole, and if the end of the line is not wide enough to display the whole word, it automatically puts the whole word on the next line without truncating the word.
3,word-break;break-all Support version: IE5 above this behavior is the same as the normal for Asian languages. Also allows any word in a non-Asian text line to be disconnected. This value is appropriate for Asian text that contains some non-Asian text. Word-wrap:break-word Support version: IE5.5 The above content will be wrapped within the boundary line. If necessary, the word wrap (word-break) will also occur. Forms are automatically wrapped to avoid distraction. Word-break:normal | Break-all | Keep-all parameter: Normal: Allows wrapping of lines within words according to the Asian and non-Asian text rules Break-all: This behavior is the same as normal for Asian languages. Also allows any word in a non-Asian text line to be disconnected. This value is appropriate for Asian text keep-all that contains some non-Asian text: the same as for all non-Asian languages. For Chinese, Korean, Japanese, word is not allowed to break. Non-Asian text syntax for containing small amounts of Asian text: Word-wrap:normal | Break-word parameter: Normal: Allows content to top open the specified container boundary Break-word: Content wraps within the boundary. If necessary, the word wrap (Word-break) also occurs when you set or retrieve whether a career change is broken when the current row exceeds the bounds of the specified container.
The corresponding script attribute is wordwrap. Please refer to other bibliographies I have written. Syntax: Table-layout:auto | Fixed parameter: Auto: Default automatic algorithm. The layout will be based on the contents of each cell. The table is not displayed until each cell is read and calculated. The speed is very slow fixed: fixed layout algorithm. In this algorithm, the horizontal layout is based solely on the width of the table, the width of the table border, the spacing of the cells, the width of the columns, and the table Content-Independent Description: Sets or retrieves the layout algorithm for the table. The corresponding script attribute is tablelayout.
Recommendation: Word-break 3C detection will show problems, resulting in Baidu snapshots will also be problematic-this property opera FIREFOX Browser also does not support word-break properties can be used white-space:normal; This way in Firefox and IE can be the correct line, and note that the words between the space can not be used to replace, or not correct line.