CSS: How to limit text shown with using "..."

Viewed 73966

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?

0 Answers
Related