You are here: Re: Detecting line wrap and adding "..." to overflowed words « HTML « IT news, forums, messages
Re: Detecting line wrap and adding "..." to overflowed words

Posted by jojo on 10/13/06 16:55

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)

I do not know wich browsers support "text-overflow" and I'm to lazy to
search for it at the moment. Just try it out or search for yourself.

HTH, jojo

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация