Firefox (and possibly a few others) support:
text-overflow: ellipsis;
but it's not cross-browser by any means. In order to get something cross-browser you need to use javascript. One way I've done this in the past is:
<div class="text">
text goes here
<div class="ellipsis">...</div>
</div>
.text {
position : relative;
}
.text .ellipsis {
display : none;
}
.text.long .ellipsis {
display : block;
position : absolute;
right : 0px;
background : #FFF;
}
then your js is simply something like this (using jQuery):
$( '.text' ).each( function(){
var $this = $( this );
$this[ ( $this.width() > $this.outerWidth() ) ? 'addClass' : 'removeClass' ]
( 'long' );
} );