Posted by Harlan Messinger on 10/13/06 17:40
jojo wrote:
> Jason wrote:
>
>> I have a div box with a border, and some padding left and right. It has
>> some text with different font sizes, and a few icons. I want to cut off
>> any overflow at the end of the line with "...", instead of the text
>> wrapping. What is the best way I can detect whether the line wrapped,
>> and how many characters to cut off at the end?
>
> You can use CSS for that:
>
> overflow:hidden; (Hides the overflow)
> text-overflow:ellipsis; (Displays "...")
> white-space:nowrap; (Prevents the text from line-breaking. Don't know
> wether it's neccessary or not)
IE defines it but I can't get it to work there or in Firefox. W3C says
it's been suggested but it's one of a number of proposed properties they
haven't even evaluated for inclusion in the CSS 3 draft yet.
[Back to original message]
|