1. Force line breaks and end with a ellipsis.
<Div style = "width: 100px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;">
Why can't I see the results?
</Div>
2. CSS wrap
Div {word-wrap: Break-word; Word-break: normal ;}
3. CSS forces English words to be disconnected
Div {word-break: Break-all ;}
For Div nesting, to enable the inner Div to wrap automatically based on the content, you can set only the DIV width of the outer and white-spance: nowrap.
Word-break: Break-all and word-wrap: Break-word both enable automatic line feed of its container content such as Div
Their differences are:
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 row whose end is CONRA (congratulation) and the next row is tulation (conguatulation.
2. Word-wrap: the break-word example is the same as above, but the difference is that it regards the entire word congratulation as a whole. If the end width of the row is insufficient, it automatically puts the entire word in the next line, instead of truncating the word.
3. Word-break; break-all supports version: ie5 or above, which is the same as normal in the Asian language. It also allows non-Asian text lines to be broken in any word. This value is suitable for Asian texts that contain non-Asian texts. Word-wrap: Break-word supported version: ie5.5 and above will be wrapped in the boundary. If necessary, the line feed (Word-break) also occurs. Automatic table line breaks to avoid opening. Word-break: normal | break-All | keep-All parameter: Normal: line breaks are allowed according to the text rules of the Asian and non-Asian languages.
Break-ALL: this behavior is the same as that of the Asian language normal. It also allows non-Asian text lines to be broken in any word. This value is suitable for Asian text keep-all that contains some non-Asian text: it is the same as normal in all non-Asian languages. Chinese, Korean, and Japanese cannot be disconnected. It is applicable to non-Asian text syntax that contains a small amount of Asian text: Word-wrap: normal | break-word parameter: Normal: allows the content to open the specified container boundary break-word: the content will wrap in the boundary. If necessary, word-break also indicates whether to disconnect or retrieve the line break when the line breaks beyond the boundary of the specified container.
The corresponding script feature is wordwrap. For more information, see my other bibliography. Syntax: Table-layout: auto | fixed parameter: Auto: Default automatic algorithm. The layout is based on the content of each cell. The table is displayed only after each cell is read and computed. Slow fixed: Fixed Layout Algorithm. In this algorithm, the horizontal layout is based only on the table width, the table Border width, the cell spacing, and the column width, but it has nothing to do with the table content: sets or retrieves the Layout Algorithm of a table. The corresponding script feature is tablelayout.
Suggestion: If word-break is detected by 3c, a problem will be displayed, which may lead to Baidu snapshots.-The opera Firefox browser does not support the word-break attribute and can use white-space: normal; in this way, both Firefox and IE can get the correct line feed, and note that spaces between words cannot be used instead, otherwise the line feed cannot be correct.