How to limit length of the text
Working on a site often there is a problem to limit length of pathway or heading of article since very long text can corrupt design of page. Usually when the text turns out too long, that does not get into one line, and it is carry over to the next line. However, for some reason very few people knows, that it is possible to tune up CSS so that the long text was cut off till the certain length, and in the end was ellipsis. For this purpose it is enough to prescribe in style (an example for pathway):
.pathway { width: 25em; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
You can change 25em to yours needs and add other attributes.
December 12th, 2007 at 12:43 pm
Thanks for the tip. Just what I needed to know
June 6th, 2008 at 1:53 am
Where would you put this piece of code in joomla?
October 24th, 2009 at 5:22 am
Note this only works in IE …