views:

80

answers:

2

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?

A: 

Using ellipsis in html

Shay Erlichmen
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
@Jason You can implement that using "native" JS, but it is shorter with jQuery
Shay Erlichmen
@Shay, I'm not looking for a JS solution, I'm looking for a solution that uses pure CSS/HTML
Jason