Home > Backend Development > PHP Tutorial > 超出div宽度部分用省略号用javascript可以弄吗?

超出div宽度部分用省略号用javascript可以弄吗?

WBOY
Release: 2016-06-06 20:06:16
Original
1242 people have browsed it

超出部分用省略号用javascript可以弄吗?有什么插件么?
比如这个demo,https://jsfiddle.net/kanjiushi/pg7c78qe/
只想保留一行,如果超出一行文字,不用换行,直接省略掉。

另外,php省略,那个函数名叫什么来着?一下忘了。

回复内容:

超出部分用省略号用javascript可以弄吗?有什么插件么?
比如这个demo,https://jsfiddle.net/kanjiushi/pg7c78qe/
只想保留一行,如果超出一行文字,不用换行,直接省略掉。

另外,php省略,那个函数名叫什么来着?一下忘了。

用CSS 就可以了

text-overflow:ellipsis
overflow:hidden
white-space:nowrap

laravel:$value = str_limit('The PHP framework for web artisans.', 7);// The PHP...

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