Truncated text

A minor little web experiment: truncated text. Resize the window and it wraps the text in a div so that only the first line shows.

9 Responses to “Truncated text”

  1. Erm - it doesn’t work until you refresh the window (in FF at least). If you resize then the boxes get bigger, but then if you hit Refresh they go back to 1 line.

    mrben
  2. mrben: WFM in both Linux and Windows FF?

    sil
  3. WFM in Galeon.

    last.fm do something similar in their lists: see http://www.last.fm/user/wjt , for instance. They appear to use tables (ick!), but it might be worth studying that.

    resiak
  4. resiak: I believe in this case it would make sense for those tables to, well, use table tags.

    Jepp
  5. jepp: agreed.
    resiak: their technique doesn’t rely on tableness, and it’s pure CSS. Neat, and I’ve linked it from the truncated-text article; it relies on you being prepared to specify the line height, though.

    sil
  6. Cool stuff! How about adding a control to “untruncate” the text? I developed an interesting method to do so: http://barelyfitz.com/projects/truncate/

    Patrick Fitzgerald
  7. Nice one. But to finish it off you really need an ellipsis at the end of the truncated text.

    Richard Rutter
  8. It seems to make resizing the browser (in my case Mozilla 1.7.12) slow and somewhat jerky. The extra text doesn’t appear straight away either.

    DG

    DG
  9. I can confirm mrben’s problem in FF1.0 on Mac.

    Marko

Leave a Reply