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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.