How to hide the excess text in css

王林
Release: 2020-11-18 17:22:30
Original
2626 people have browsed it

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.

How to hide the excess text in css

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;
Copy after login

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;
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!