How to hide redundant words and replace them with ellipses

一个新手
Release: 2017-09-20 09:28:16
Original
2749 people have browsed it

Similar effects are often encountered on the front end. For example, in the picture, "...." after "Fenghuaxueyue and Ancient Town Volcano-..." cannot be displayed. When hidden by default, use... instead.
How to hide redundant words and replace them with ellipses
You only need to add the following 3 css attributes to the element to achieve this .

            overflow: hidden;//多余的隐藏            
            text-overflow:ellipsis;//多出来的用省略号代替            
            white-space: nowrap;//不换行
Copy after login

The above is the detailed content of How to hide redundant words and replace them with ellipses. 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!