13

Possible Duplicates:
Is it possible to implement the effect of overflow:ellipsis with javascript or css?
How do I indicate long text into a smaller fixed column with CSS?

I want to trim text if it's greater than 300px wide with "..."

For example, if I had:

<ul>
<li>this is greater than 300px, than only display as much of the text that is 300px wide and then replace the remaining text with "..."</li>
<li>short, don't trim</li>
</ul>

Would display as:

this is greater than 300px, than only ...
short, don't trim
|----------- 300px wide ----------------|

How would I do that with CSS/HTML?

Community
  • 1
  • 1
Jason
  • 201
  • 1
  • 3
  • 8
  • 1
    possible duplicate of [Is it possible to implement the effect of overflow:ellipsis with javascript or css?](http://stackoverflow.com/questions/2995656/) and http://stackoverflow.com/questions/3067696 and http://stackoverflow.com/questions/802175/ and http://stackoverflow.com/questions/486563/ man I am bored of this question – Matt Ball Oct 11 '10 at 21:23
  • I tried the above and it didn't work using **pure** CSS/HTML. It only worked if I used JQuery and I don't want to use JQuery. – Jason Oct 12 '10 at 15:52
  • **This might be a duplicate BUT I haven't found a pure CSS/HTML answer that WORKS. There has been suggestions to use code like linked but that code does NOT work.** http://stackoverflow.com/questions/2108740/how-do-i-indicate-long-text-into-a-smaller-fixed-column-with-css/2109035#2109035 – Jason Oct 12 '10 at 16:12

0 Answers0