1

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 ?

wamp
  • 5,789
  • 17
  • 52
  • 82

2 Answers2

7
text-overflow: ellipsis;

See http://www.quirksmode.org/css/textoverflow.html and https://developer.mozilla.org/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.com/acuti3. There are a bunch of other jQuery plugins for besides this.

kennytm
  • 510,854
  • 105
  • 1,084
  • 1,005
  • 1
    Support all other browsers other than firefox? Anyway, I don't want to give up firefox.. – wamp Jun 08 '10 at 08:21
1

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

Knu
  • 14,806
  • 5
  • 56
  • 89
  • It looks like -moz-binding won't be supported in Firefox 4: https://bugzilla.mozilla.org/show_bug.cgi?id=546857 – Joril Jan 12 '11 at 13:21
  • @joril at least `text-overflow: ellipsis` [will be supported](https://bugzilla.mozilla.org/show_bug.cgi?id=312156) – Knu May 24 '11 at 23:57
  • wow, a 6-year-old feature request :) Well better late than never I guess :) – Joril May 25 '11 at 07:29