When the text exceeds the range, the excess part will be hidden. css code.mi { width: 200px; overflow: hidden; text-overflow: ellipsis; white-space:nowrap;} 2. Multi-line hidden html code
When text"> Two ways to hide excess text content-HTML Tutorial-php.cn

Two ways to hide excess text content

巴扎黑
Release: 2017-03-14 10:20:35
Original
2551 people have browsed it

Hide the text beyond the part, summarize two methods.
1. Single line hiding
html code

当文字超过范围的时候,超出部分会隐藏起来。

Copy after login

css code

.mi { width: 200px; overflow: hidden; text-overflow: ellipsis; white-space:nowrap; }
Copy after login

2. Multi-line hiding
html code

当文字超过范围的时候,超出部分会隐藏起来。可以设置第几行开始隐藏。

Copy after login

css code

.mi { width: 200px; overflow: hidden; display: -webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; }
Copy after login

The above is the detailed content of Two ways to hide excess text content. 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
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!