How to hide the excess part of text in css: You can use the text-overflow attribute, such as [text-overflow:ellipsis;]. The attribute value ellipsis indicates the use of ellipses to represent excess text.
Attribute introduction:
The text-overflow attribute specifies what should happen when text overflows the element containing it.
(Learning video sharing: css video tutorial)
Grammar:
text-overflow: clip|ellipsis|string;
Attribute value:
clip Trim text.
ellipsis Displays ellipses to represent trimmed text.
#string Use the given string to represent the trimmed text.
Example:
The overflow of a single line of text displays an ellipsis
overflow: hidden; text-overflow:ellipsis; white-space: nowrap;
Related recommendations: CSS tutorial
The above is the detailed content of How to hide the excess text in css. For more information, please follow other related articles on the PHP Chinese website!