Forum Moderators: not2easy

Message Too Old, No Replies

Restricting div height and adding an ellipsis to indicate truncation

Ellipsis in Firevox by using CSS

         

SilverLining

4:31 pm on Apr 4, 2007 (gmt 0)

10+ Year Member



Hi

I have a very small space to fit some text in, so ideally would like to restrict the amount of characters (by height/two lines of text) and then to display an ellipsis.

This does work in IE, but in Firefox, althought the text is truncated too, the ellipsis is not displayed.

Here is a snippet of CSS:


.text {
width: 100px;
height: 15px;
max-height: 15px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}

Is it possible to get this working in Firefox?

sgietz

4:40 pm on Apr 4, 2007 (gmt 0)

10+ Year Member



text-overflow only works in IE. You could probably achieve the same in FF with JavaScript.

SilverLining

10:01 am on Apr 5, 2007 (gmt 0)

10+ Year Member



Thanks. Thought this was part of CSS3, but see now that it is only supported by IE (IE6?). Want to stay away from too much JS.