CSS3 magic – using ellipsis
No more counting chars, just use some CSS3 magic:
{
overflow: hidden;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
white-space: nowrap;
width: 100%;
}
The property text-overflow
is now supported by all major browsers.