Tag: SPL amp element hid lamp requires splay style elasticity
First, you need to know the three properties of CSS.
Overflow:hidden; Out-of-text hiding
Text-overflow:ellipsis; Overflow with ellipsis display
White-space:nowrap; Overflow does not break line
These three are the basic properties of CSS and need to be remembered.
But the third attribute, can only display one row, cannot use here, then if displays many lines?
CSS3 solves this problem with the following workaround:
Display:-webkit-box; Displays the object as an elastic telescopic box model.
-webkit-box-orient:vertical; Arranges child elements vertically from top to bottom (sets the arrangement of child elements of the telescopic box)
-webkit-line-clamp:2; This property is not a canonical property of CSS and requires the combination of the above two properties to represent the number of rows displayed.
The final CSS style is as follows:
Overflow:hidden;
Text-overflow:ellipsis;
Display:-webkit-box;
-webkit-box-orient:vertical;
-webkit-line-clamp:2;
CSS text is hidden and displays ellipses beyond 2 lines