Wednesday, October 26, 2005

Ellipsis in Internet Explorer

I forget this repeatedly - so here it is for future reference.

To get a string of indeterminent length to display inside a fixed width with ellipses indicating that it is longer, apply the following CSS styles:

overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;

You'll also need to apply a width style. If you want your entire string to appear in a tool tip, put it into the title attribute of whatever element it is going into.