0

Possible Duplicate:
Insert ellipsis (…) into HTML tag if content too wide
With CSS, use “…” for overflowed block of multi-lines

Hi I am trying to have a div tag to display a question this div box is constrained by size, because of the lay out specification this div tag should show as much text as it can, if it can't show all, it should have ellipsis (i.e. .....) at the end

currently i want it to display maximum 3 lines in that div

if it is more than 3 lines, than it will show ellipsis

example:

This is a question, from follow student who attended...

my current style for that div tag is the following:

 .question { max-height: 40px; max-width:200px text-overflow: ellipsis; overflow: auto; } 

this doesn't do the trick... please help

3

1 Answer 1

1

Add "overflow: hidden" to the above

Sign up to request clarification or add additional context in comments.

2 Comments

that didn't fix it sir. it only shows the letters that can fit in the box, rest are 'hidden', no ellipis shown
This cannot be done with pure CSS. You'll need JavaScript to do multi-line ellipsis on the client side. There's lots of jQuery plugins available that do this today.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.