Jump to content

Ellipsis


stijn0713

Recommended Posts

Hi guys,

 

Does anybody have a good (i.e. standardized, cross compatible) solution for adding an ellipsis and cutting of text after the div is 'full'.

 

My div has these properties and i want to cut of the text with a read further link

 

width: 220px;
height: 180px;
border: 1px dashed green;
padding: 10px;
overflow: hidden;
line-height: 26px;
font-family: Velvet;

Link to comment
https://forums.phpfreaks.com/topic/268940-ellipsis/
Share on other sites

Like Adam said, CSS support for this is definitely slow. The biggest hurdle is that unless you're using a monospaced font, neither a PHP nor JS approach will work 100% of the time with an absolutely defined element size. You can get relatively close, so it's best to keep it flexible with something like a min-height or similar.

Link to comment
https://forums.phpfreaks.com/topic/268940-ellipsis/#findComment-1381999
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.