最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Is it possible to implement the effect of overflow:ellipsis with javascript or css? - Stack Overflow

programmeradmin4浏览0评论

I want to show ... when overflow happens,

but sadly in css there is only overflow:hidden which is near but not exact what I want.

Is it possible to implement it ?

I want to show ... when overflow happens,

but sadly in css there is only overflow:hidden which is near but not exact what I want.

Is it possible to implement it ?

Share Improve this question asked Jun 8, 2010 at 8:11 wampwamp 5,96917 gold badges54 silver badges84 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 7
text-overflow: ellipsis;

See http://www.quirksmode/css/textoverflow.html and https://developer.mozilla/en/CSS/text-overflow. Doesn't support Firefox, however.


Edit: There's a jQuery plugin for this. After you have installed it, call

$(thatElement).ellipsis();

to activate the style. See http://jsbin./acuti3. There are a bunch of other jQuery plugins for besides this.

-moz-binding > firefox
-o-text-overflow > opera
text-overflow > ie + webkit (chrome/safari)

发布评论

评论列表(0)

  1. 暂无评论