PDA

View Full Version : Multi-line text-overflow:ellipsis



a2thek26
August 7th, 2008, 04:13 PM
Hello,

I have a div with text in it...the text is being pulled from a database so it varies in length.

The div has a defined width and height so some of the text will be clipped off...



#gifts #products #info { height:80px; font:12px/16px verdana; overflow:hidden; text-overflow:ellipsis; margin:12px 6px 12px 0px; }


text-overflow:ellipsis puts "..." at the end where the text cuts off...this only works with white-space:nowrap..which only allows for 1 line of text...however i need it to be multiple lines and still add the "..."

Any ideas on a work around for this?

actionAction
August 7th, 2008, 04:20 PM
You could try jQuery Truncate, here is a link to one library, though many exist: http://www.reindel.com/truncate/

a2thek26
August 7th, 2008, 04:34 PM
yes! thank you much

actionAction
August 7th, 2008, 04:46 PM
No problem! :thumb2: