Extract the length of the title in a CSS style.
1. Title style for SPAN or LI
The code is as follows: |
Copy code |
. Text-css {
Display: block;/* Add inline objects */
Width: 31em;
Word-break: keep-all;/* do not wrap */
White-space: nowrap;/* do not wrap */
Overflow: hidden;/* Hide the content beyond the width of the content */
Text-overflow: ellipsis;/* indicates the omitted mark (...) when the text in the object overflows. It must be used with overflow: hidden. */
}
|
We only need to apply the. text-css style to LI or SPAN. The above style can be modified by la Jiang as needed.
2. TABLE truncation style
The code is as follows: |
Copy code |
Table {
Width: 30em;
Table-layout: fixed;}/* The following definition of td takes effect only when the layout algorithm of the table is defined as fixed. */
Td {
Width: 100%;
Word-break: keep-all;/* do not wrap */
White-space: nowrap;/* do not wrap */
Overflow: hidden;/* Hide the content beyond the width of the content */
Text-overflow: ellipsis;}/* indicates the omitted mark (...) when the text in the object overflows. It must be used with overflow: hidden. */
|
The above section is used to intercept tables. Generally, we use less.